Actually yes they can, if you have snorted it or smoked it then residue would be detectable by a sniffer dog for quite some time afterwards, you may not think that there is anything left but a dog's sense of smell is said to
be a thousand times more sensitive than that of a humans,
In fact, a dog has more than 220 million olfactory receptors in its nose, while humans have only 5 million. In case you are wondering how I know, my hubby has trained sniffer dogs in the army.