Yes. All the time. In fact, since I'm living in a dorm, I only have access to public bathrooms. I've used outhouses that smelled horrible(they were just holes in the ground with a metal covering) that didn't even have doors, just three walls and a short, zig-zag-y "hallway" in front. And I've been camping to places that didn't have ANY bathrooms before.
How does that work? Well, you dig a hole, then you take off your pants-[INAPPROPRIATE MATERIAL REMOVED]-then all you have to do is bury the bundle of leaves, return the eggs to the nest, wait for your pants to sun-dry, and you're good to go. Simple, really.
I also "went" on a train, once.