A dog can feel threatened if it is surprised by someone coming into its yard or house, or if it doesn't recognize the person approaching. Dogs depend on smell to identify acquaintances, so even if you've met the dog before, approach it slowly and give it a chance to sniff your hand and respond with a wag before you come onto its territory. The same applies when reaching an arm toward a dog through a wire fence or a car window. Take it easy. You may have friendly intentions, but the dog doesn't always know that.
Dogs sometimes bite out of possessiveness or jealousy.
A dog's possessions may be food, bones, balls, sticks and frisbees. Never snatch anything from a dog's mouth. It is just as rude to do that as it would be for someone to snatch a sandwich from your hands. Mother dogs are especially protective of their pups. Most owners find it comforting to think their dogs would defend them if they were attacked, but this type of possessiveness can backfire.