People here just have no clue what percent of otherwise normal friendly family dogs might bite if you do something like that or have a person try to take their food while they are eating or if you climb on them, poke or prod them while they eat.
They live in a type of gleeful ignorance mainly because thankfully no one is doing that and getting the dog to bite. But many, MANY, would.
So I guess the answer could be 'kill them all' but part of the answer is teach your kid a proper respect if animals. ALL animals.
But people today are lazy. I'm always shocked at parks when parents allow their toddlers to just walk up and not only touch any dog they see but many toddlers will grab them. Grab an ear, a handful of fur, etc
When that dog bites the lazy ignorant owners yell and point fingers at the dog while taking zero responsibility themselves
Look, I'm not speaking to how I want things. I would want every dog to never exhibit aggression to a human. But I am speaking to reality.
You can say all you want 'HE SHOULDN'T ' and hope that protects your kids from bites or you can teach your kid proper respect of animals. I know the latter takes effort so most will just do the first and cross their fingers and hope.