Sometimes, I show my teeth when I’m getting my back scratched. I may sort of look as though I’m smiling, but my “smile” really looks like more of a grimace, even if I’m thoroughly enjoying my back scratch.
People sometimes assume that a “smiling” dog is grinning happily, but like people, dogs don’t all mean the same things with their expressions. Dogs can have what is actually a submissive “grin” or even an aggressive toothy “smile” which is really more of a snarling expression.
In order to better understand a dog’s emotions, it’s probably a good idea to consider their whole body language. That “smile” may have a different meaning than a happy “grin!”