TSA dogs are mostly not (I've met one TSA Labrador who would alert to explosives ... and yogurt), but the local police dogs, used extensively in at least NYC, are trained to alert to narcotics as well, as if they're trained in detection, usually it's both explosives/narcotics for use as working police dogs. The customs dogs and USDA beagle brigade will also alert to narcotics - the customs dogs are even trained to recognize and alert to large quantities of currency.IIRC The security at the airport is charged with looking for weapons, explosives and incendiaries. Very few, if any, sniffer dogs are trained to detect those things as well as drugs.

The few the TSA has that will do narcotics detection is because they picked up some pre-trained Labradors, and some of them are intelligent enough to remember scents and behaviors for years (I was bored waiting in line and chatted up a handler whose dog was taking a breather). Mine (who's a family pet) is smart enough that when my back seized up and I was on the couch, and was sending him to get my fiancé from another room behind a closed door, realized he couldn't open the door and jumped up and grabbed my cell phone from the table across the room and brought it to me and dropped it on my chest then sat down expectantly knowing that he had done the right thing - despite never having been taught what a cell phone is or what it does or anything, he figured it out on his own.