Yes, honey bees have a sense of smell, and they use their sense of smell to communicate and locate food sources. Honey bees have olfactory receptors in their antennae, which they use to detect scents and communicate with each other.
It is not well understood why honey bees are sometimes attracted to the smell of human hair. Some theories suggest that the scent of certain shampoos, conditioners, or hair products may mimic the scent of flowers or other food sources, causing bees to be attracted to the hair. Others suggest that the bees may be attracted to the natural oils produced by the scalp.
Regardless of the reason, it is generally best to avoid having bees near your hair, as bees can become aggressive if they feel threatened, and bee stings can be painful and even dangerous for some people. If you encounter bees near your hair, it's best to slowly and calmly move away from the area to avoid being stung.