A question many parents ask- my response- "That depends. Is your kid good with dogs?" The kid/ dog dynamic is an important one. Most young kids are afraid of dogs, and many dogs are afraid of kids. I am very lucky to have friends with kids that are "good with dogs". It is important to have good experiences right from the beginning.
If you have young children, and they see a dog they would like to pet (touch)- here is the proper etiquette. They should ask the person with the dog, "may I please pet your dog?" If the dog is not friendly, the owner can prevent a bad situation, and even if the dog is friendly, the owner has the opportunity to prepare for the encounter. For example they may ask the dog to sit, or they might kneel down to be at the level of the dog and child.
Next, your child need to hold their hand out, palm up, for the dog to sniff. I tell kids it is like "introducing yourself" to the dog. Many kids want to avoid the mouth, but unfortunately the nose also happens to be at the end of that mouth and dogs want to sniff. Kids who try to bring their hands up over the dogs head and attempt to pat them on the head without letting the dog sniff them first may feel that the dog is "attempting to bite" when the dog picks his head up to sniff the child. Most of the time, once the dog has sniffed the hand, they will just allow the child to pet them with out moving their head around in a manner that seems threatening to the child.
Your child should never approach a dog that is tied up, or stick their hand through a fence to pet a dog. If they see a loose dog, never run. They can "Stand still and pretend to be a tree."- the dog may just approach and sniff the child, or they may ignore the child- but if the child runs away, it might cause the dog to chase them. Teach your children how to behave around dogs. The relationship humans can have with dogs is so rewarding, but communication between our two species is a learned process and it is not always a natural process.