I had a (spayed) bitch that used to do that…...usually sniffed something, then clacked her teeth. She seemed to do it more as she got older. I had forgotten about it until I saw this thread. 🙂
In horses it is a sign of submission. Foals do it, and usually outgrow it, but I have a 25 year old mare that will still teeth clack on occasion.......usually when she is in heat and shining up to my gelding! Go figure.....