Our dog knows not to “kiss”. I’ll get in his face and tempt him making smaking noises with my mouth. His tongue gets going too.
Every once in awhile his tongue will give a glancing blow to my face and he stops and looks down all ashamed. Then I make sure he knows it’s no big deal and give him some more pats on the head.
I’m guessing just living in the same house with a dog, petting them, etc. you pick up enough of their germs.