That isn't how it works, listening to conversations would need too much bandwidth or processing power to be useful.
More likely that whatever prompted your coworker to think about those cookies also triggered the ad.
Or they have been getting those ads without thinking twice about them until they noticed when they were thinking about them.
Or it is just plain coincidence.