Unless there is animosity between them, coworkers who happen to see each other by chance at the store, on the street, or elsewhere other than their workplace, will be inclined to smile.
I think there are two things happening.
1. Identifying a familiar face from among the faces of countless strangers who populate a person’s field of view over the course of a day is a welcome reassurance that passageways exist between the realities governing workplace and non-workplace life.
2. Seeing someone outside of work who you associate with work is exciting for its rude disregard of established expectations. The restless curiosity to see what happens when authority is rejected survives our youth and we continue to harbor it into adulthood. The only difference is that, rather than being parents or school, authority is your workplace, and it has been rejected not by staying out too late or skipping class but by seeing a coworker outside of business hours.