While many dogs chatter their teeth when they are smelling a urine spot, dogs may chatter at other times for other reasons.
A common cause for teeth chattering is when a dog is anticipating something.
Some dogs are known to teeth chatter when they are anticipating a training session or during play.