Part of this falls on parenting. I once watched a dog bite a small child in the face. The parents weren't watching their toddler and the dog had enough of the kid and responded. The parents were ofcourse upset at the dog but at the end of the day If they had been doing their jobs as parents it could have been avoided.
This is a different scenario than an aggressive dog that snaps suddenly and is unpredictable
Ok,but the dog should have whined and cried and then run away.regardless of the fact the parents let their kid in a strange dogs face,which is never smart