I have a friend that trains dogs and has had them around all of their kids even when they were infants and toddlers. He has told me that if you really want the dog you need to first research what type of dog you are going to get and get one that will have a good temperament and is a good "kid friendly" breed. If you are getting a mixed breed then you might want to ask the people that have the puppies (assuming you aren't adopting from a shelter) what the parents are like and make sure they were kind of mellow and good around people and kids.
Second you need to be willing to teach your kid to be nice to the dog. I have seen this go two ways. First a friend taught his daughter to be nice to the dog and punished her when she was mean to it. Soon the girl and the dog got along great and had no problems. My brother's daughter would be mean to their dog, the dog would claw or snap at her and they would then punish the dog. The dog now lives in a kennel in the garage or sometimes in their utility room and is scared of everyone and everything.
Just use some common sense and teach both your kid and dog to be nice to each other and they will be best friends for many years to come.
Sorry for the long post
