Yep. Public toilets might get a little grimy, but they’re very unlikely to pose any threat to your health. Most bacteria that could be any danger to people perish quickly on barren bathroom surfaces. And a functioning immune system (plus hand washing!) will stave off most of the rest.
“The restroom isn’t that dangerous,” said Jack Gilbert, a microbiologist at Argonne National Laboratory in Illinois. “The organisms which can grow there have a very low probability of being able to cause an infection.”