Dogs/cats and toddlers

Rainbow
How did you teach your toddler to be gentle with your pets? 
We have a very large dog (110 lbs and 32 in tall). Luckily he is a total sweet heart and very patient but I still, I don't want my 2 year old to hurt him and get bit one day. You just never know.
 For the most part she is pretty good and she never does anything to him because she's angry. It's usually her getting too excited and grabbing his face really hard or hitting him but in a playful manner. Or pulling his ears or laying on top of him. When she does this we always tell her no, be gentle, and then move her away from him. He doesn't seem to be bothered by it and I think he does love her because he is very protective of her (and because she gives him all the good snacks). But I don't want him to instinctually nip at her for hurting him because I honestly would never trust him again. 
I'm pretty sure most of this behavior is mine and my husbands fault. Like I said, he's huge and so we pat him on the back and butt and head all the time which probably looks like hitting to her, and he comes up to me to hug me and so I hug him back by basically hugging his head, and he loves having his ears rubbed so I rub them a lot and if he's laying down I come and lay on top of him a lot to cuddle. I know he likes all of it when I do it because he comes up to me for it but my daughter just does these things too roughly. 
I don't know how to make her understand that she can pat him and hug him without doing it hard or grabbing. 
Also want to add, she's not like this with other dogs, only ours. She approaches other dogs with caution and pets them very gently. 
TLDR: my 2 year old is rough with our dog but not intentionally being mean, just too excited. How can I get her to be gentle with him?