From this article here:
There are other circumstances that can provoke a dog to bite a child. Running, playing, screaming kids can trigger an instinctive predator-prey reaction in some dogs. Children who rough house and wrestle with dogs unknowingly encourage them to use their teeth. Dogs equate this kind of play with littermates or other dogs where using teeth is allowed. Startling a sleeping dog or petting him when he's eating can also provoke a bite.
What can be done to prevent dogs from biting children? I feel that, first, it's essential to understand that almost any dog will bite under the right circumstances. Second, a dog is a dog, an animal whose behavior isn't the same as humans and can't always be predicted with 100 percent accuracy, no matter how friendly or reliable he is.