Parents have been asking me to flush out when a child is old enough to use a public restroom on their own - particularly when a boy is with his mom or a girl with her dad.
Initially, a young child may be fearful of using a toilet they are unfamiliar with. In this case, you may need to have your child use the potty before going out and keep your outings short but this will avoid the problem without really solving it.
One idea is to gradually progress from your home to someone else's home, and then to a one-room public bathroom in a store or restaurant before your child is ready to master the multi-stall setup.
A great idea is for you to use a public toilet with your child watching to see that it is okay and not a scary place even before they begin toilet training to get used to the idea that there are more toilets than just the ones in your home. If you can use a family or unisex bathroom, that is ideal.
Once children reach the age of 4-6, they may want their privacy and understand the differences between a men's and ladies' room. In this case, they will need us to respect their desire for a same-sex facility, although usually an adult will go in with them and "stand guard" until about age 7 or 8 or until the child shows the maturity that they wish to go in alone. Even then, a child should be big enough to reach the faucet for himself or herself, and boys should be tall enough to use a urinal.
If you are not of the same sex, a good idea is to pick a bathroom where your child is within shouting distance of the door you are standing outside. Even then remind your child never to talk to, or go with, a stranger in the bathroom for any reason.