Some have asked if it is okay for their children to interact with dogs that their parents/guardians isn't sure of, the answer is a straight no from me. When interacting with a dog that you don't understand well enough, many risks are present and adults will always need to make wise decisions to ensure that their child is safe.
Below is a list of concerns that you will need to consider:
Temperament of the dog
Every dog is different in terms of personality and behavior, usually it isn't related to the breed so don't go thinking that all golden retrievers are friendly and all mastiffs are aggressive, it doesn't work that way. The reaction of a dog towards strangers depends on 3 things - the environment, how well trained the dog is and lastly, how the stranger approaches the dog.
For example, if a dog is well trained but the environment is uncomfortable, maybe a scenario where there's thunderstorm, a friendly dog can suddenly become aggressive without much warning when approached, such is a form of self defense and natural instinct, thus humans should never think that they always have everything under control. Same thing, if the environment is good but the dog is approached in the wrong way, it may also attack as a form of defence.
Even if we are talking about dogs that are not aggressive, most wouldn't enjoy being approached by strangers physically right away, this is similar for humans, you might not hate people but you probably wouldn't enjoy strangers touching you physically. Of course dogs are supposed to be more attention seeking than humans, if you see dogs running to you and licking all over your face, then of course it is completely fine (in terms of it's behavior towards you).
This is a very sensitive topic, dog hygiene. As much as we love dogs and do not mind touching them even if they haven't bathed for weeks, the risk of bacteria contamination is present and we need to face this fact. I've met many owners who are very clean and dedicated to their dogs, I've also met many who doesn't care about cleanliness, leaving their dogs smelling bad and having lots of matted fur/hair. This is very common so you might need to consider every owner and their dogs differently.
There are also owners who keeps their dog clean, but doesn't practice proper prevention, so dogs can still get bacteria and dirt from grasses, dustbins and other objects, worst case is if they have fleas and ticks on their body. If you are unsure then it will be best to refrain from physical contact till you know the dog or its owner well enough, I'll be frank to say that it's not worth it for children to get sick over such things.
Acknowledgement from owner
So if the dog is friendly and clean, then what we waiting for? Owner's preference of course, many times people see a dog that is cute and friendly they'd rush over to vent all their urge out without even thinking about the feelings of the owner. This act is normally done on impulse, people who do this might say that it's because the dog looked like they wished to be cuddled, but in fact it is the humans who actually want to cuddle the dog instead.
You are probably calm now while reading, so think again, have you ever thought about the feelings of the owner before doing something like that? How do you know if the owner is comfortable with this action, maybe the dog is sick, maybe it is undergoing training, maybe the owners are not ready, there are many reasons and no matter how ridiculous they sound, the dog is not yours.
In short, you should never encourage children to approach every dog they meet, talk to the owner first to know if it is okay, and if you are very sure that the dog is friendly, let them come to you instead.
If you wish to venture into a dog's territory or allow another to approach yours, be prepared that anything can happen, don't go threatening when something happens, the dog doesn't understand, be responsible and take necessary precaution.