Sort:  

A dog most likely interprets a smiling person as baring their teeth, which is an act of aggression.

It probably looks more at a person's body language since that's what usually shows if something's aggressive.