That would be the baby schema effect. A lot of animals, us included, has infants with similar traits. These traits is then something that these animals recognize and influence their behavior. This is why we find babies, kittens, lambs and puppies cute. In cat and dogs this shows up as higher tolerance for bad behavior.
I think that to a certain extent they recognize the cub-like behavior of human babies and act accordingly.
Kittens and puppies do the same exact annoying shit to their bodies as human equivalents as well, not to mention babies/toddlers smell distinct from adults/adolescents, even to humans (or maybe just me).
Hold on. Going to sniff a baby for science.
They understand neoteny / youth, which is pretty cool!
Sometimes. In other cases, especially when the toddler cries, the dog recognizes that cry as typical for prey and mauls or kills the toddler.
My dog is pretty tolerant of having his ears pulled when playing with other dogs. I don't what it is about the skin of dogs but they are pretty resilient to this.