If you do not give your dog enough physical and mental exercise, a dog could chew on itself to relieve bordom. A skin allergy could also make a dog bite itself. The old standby of fleas, ticks, and dry skin also can itch.
Dogs can be bored, itchy, or in pain. It's scratching itself with it's teeth and does so for the same reasons that humans scratch themselves. A consultation with a health care provider may be in order.