If a smell is near a sleeper, it can enter the the olfactory glands, and the data is sent to the brain. From there, a dream image that relates to the stimulus (smell) is created and included in the dream.
This is the search page for you to get all the posts in this series “Factors causing dreams”.