All dogs have their own unique personalities and temperaments. A dog’s upbringing, socialization, training, and environment will all play a role in its behavior and propensity for biting. Dogs rarely, if ever, bite for no reason. Us humans, (particularly children) often misinterpret a dog attacking “out of the blue” and “without warning” because we miss the warnings. 70% of reported dog bites are of children bitten by a dog that they know and love. You must be willing to teach your child/children to be gentle with your dog, respect their space, respect their possessions and behave nicely with them. Dogs don't like their tails being pulled, having their ears tugged, being cuddled really tightly or have a child on top of them. It's amazing what dogs will put up with before they go to bite but once they do, it doesn't generally end well for the dog.
Growling is a clear warning that should not be ignored. Don't scold a dog for growling, instead remove him/her from the situation. If a dog is scolded for giving a warning you're teaching him to go straight to biting. Put him in another room, his crate somewhere where he feels safe. You need to be able to pick up any early signs that your dog is getting stressed and intervening early.
Some breeds of dogs are genetically predisposed to be more aggressive than others making them excellent gaurdians. Do keep this in mind when adopting a dog/puppy known for these tendancies.