Leave the dog alone
As a dog trainer I'm glad to hear he is giving her a warning - it's a good thing. But if she doesn't respect it and if no one steps in, he will escalate to get his point across and it may result in her getting nipped. (A nip is faaar different from a bite.) Something like 95% of all dog bites occur in the home by our own dogs, not from strange dogs. So step one is to respect the dog's warning signs and either place him in a room away from her, behind a gate, or, my preference for my own child, if SHE is the one pestering the dogs (rare in our house but it happens), then SHE is the one who goes away. The way I see it, I am the peacekeeper of the house - I'm not going to make my dogs go into isolation if they've done nothing wrong bc it can send the wrong message. They start to think that whenever kids are around, they get 'put away' and they can become resentful of the kids and might growl before they are even bothered. So putting DD into her room being a gate or into her pack n play is how I make it clear that her behavior was unacceptable and therefore she cannot be with the dogs at the moment.
The other aspect she needs to learn from this is that while her own dog may tolerate these behaviors, not all dogs will. MOST dogs, don't like hugs. Most people hug their dogs not knowing how stressful it really is to them. If kids don't learn at home how to respect their own dog, they won't do it with a dog at a friends house and that can be dangerous. I do classes with my older dog where we teach pre-school/elementary kids to ignore dogs they meet and not fall for the "if the tail is wagging he's friendly" myth. I have Australian Shepherds. They love my family and my DD, but they don't openly accept strangers the way some other dogs may. I like having them in the classroom bc it shows kids that not all dogs are like labs, goldens, beagles, etc - they don't seek attention from strangers. they tolerate the attention but don't always return it - a good lesson for all people to learn.
You might check with your library about classes they may do with animals or request them to host one - there are plenty of trainers out there that love to put on demos - even calling up your local dog training club and arranging something through them might be worthwhile.
Does he listen to commands? For instance, when she does one of her things to him, you could give her a warning that if she does it again, ___(dog's name) is going away, and if she does it again, call him and lead him away into a different room that she can't follow him into.
Or, maybe she has, or you could get her a lab-like stuffed animal, and ask her to show you what she wants to do to your dog, and if she does it, speak for the stuffed animal and say "Ouch, that really hurts! It makes me sad." And try to get her to associate sadness with doing those things to your lab.
Two year olds are driven by impulse because they lack higher brain development to reason and control their impulses. From birth to three, they have little cognitive development.
Some suggestions, model 'gentle' with your hand on top of hers petting the dog and utilize baby gates when the dog needs space. Baby's safety of course is paramount, fortunately you have a tolerant dog, still even so, animals can be unpredictable. This phase should pass. It is challenging though in the meantime.
Around that age nothing could stop my son from running after my dog, except me catching him and redirecting him to another activity.
I have found Margot Sunderland's book 'The Science of Parenting' really insightful, for understanding what can be expected as the brain develops. It helped me to see the limits that are placed on a child due to an immature brain. http://www.amazon.com/Science-Parenting-Margot-Sunderland/dp/075663993X
If all else fails, redirect, redirect, redirect ("Hey, look at that birdie outside of the window!")