A dog can be a kid's best friend, but be aware that not all dogs will get along well with children, and not all children will get along well with dogs. Most problems occur with very young children. If your kids are under six years old, you may want to wait before adding a dog to the family until you're sure that everyone understands what "gentle" and "leave the dog alone" mean.
Of course, if you already have a dog when you find out there's a baby on the way, it's a different story! Most dogs do fine with new babies. They understand the concept of "puppy" and even though a human pup may not have a tail, many dogs tolerate and even love the littlest humans. As you make plans for the new arrival, plan how you're going to handle the dog's exercise and attention needs while you're getting used to parenthood.
When the baby becomes a toddler, arrange for some distance between child and dog, and supervise their interactions. A fenced yard may be the best solution. A dog who gets some kid-free time each day is more likely to be tolerant of a 2-year-old's version of "love."
When dogs bite children, it often means that a child -- often playing without adequate supervision -- has done something the dog doesn't like. It's meant as a warning, not an attack, and usually doesn't result in serious injury. Whenever this happens, it's the responsibility of the adults in the situation to prevent such bites from occurring by carefully supervising child-dog interactions and removing the child from the situation if they see "alpha dog" behavior, such as bumping into the child or baring of teeth.
The adult is responsible for training both child and dog. Until you are completely sure both of them know how to interact safely and when to stop, never leave them alone together.