Here is a quote from a website about teeth grinding.
Teeth Grinding - Dog teeth grinding, also known as bruxism, is a common sign of oral pain. Gums are usually inflamed, so if you notice your dog is grinding his teeth, check his mouth for red, sore looking gums.
Teeth grinding is usually caused by misaligned teeth. If a dog?s teeth are very crooked or his jaw is out of line, he may grind his teeth to ease pain.
Much like humans, teeth grinding may be caused by stress. Any stressful or exciting situation may cause your dog to grind his teeth.
Upset stomach or pain is a very common cause of bruxism. Along with teeth grinding, your dog may be vomiting, shaking or have a fever or appetite loss.
Teeth grinding may be because of pain. If your dog recently had surgery, especially in the mouth, he may grind his teeth to ease pain.