My dogs are trained, certified and registered Therapy Dogs. They know when to put on the really good behavior when their Therapy Dog vests go on. They pretty much dive into them anticipating a happy visit and yummy treats as we drive home.
No face licking ever, paws up only when asked, generally very, very well behaved.
They are not stupid, nor are they human. They are dogs who love visiting and get very excited at the idea of visitors to the home and adore visiting outside the home!
Not sure what the OP's issue is, to be honest. My out-going pups know "let's visit" (be affectionate) and "stay cool" (used for non-dog loving home visitors who do not want affectionate dogs in close proximity) but they have little comprehension of *who* goes with *what* unless I tell them what to expect.
Their default is affection. They always think that strangers are very cool, unless warned otherwise. They are terrible watch-dogs

and very social animals who anticipate lots of cuddles, but will back off on request.
ETA. Whoops, I lost the primary question there. I clicker train with positive reinforcement and lots of food rewards (food gradually phased out).
My answer: Yes, dogs can certainly anticipate a fun interaction given consistent signals and positive reinforcement. No, they will not necessarily anticipate little *Johnny* who they have not met as a specific fun interaction unless you tell them *Johnny is a good thing.
If you have a dog about to meet *Johnny* you can probably train your dog to anticipate happy stuff with the code word *Johnny*. And, yes, your dogs will happily anticipate his visit even if they have never met him before.