Dogs can do that because their noses contain 900 different types of
olfactory receptors, chemical detectors in cells that respond to many different kinds of odor molecules in
particular ways.
The received notion, as I understand it, is that molecules of a
particular oderant have a unique shape that will latch on to some of the five or six million
receptors in our
olfactory area and thus trigger signals that cause the brain to register a
particular smell.