The police can NOT use a dog as a pretext for a search, if it can be shown that the dog did NOT act as the dog had been trained when drugs are present, but did the same act upon a signal from the dog's handler, then that indication of drugs being present is NOT probable cause for a search. If it can be SHOWN that the dog did NOT act on the smell of drugs but upon a hand signal, then the search is illegal (i.e. no probable cause).
One of the problems with using dogs is they can smell Cocaine on 20 dollars bills. Cocaine is one of the stickiest substance known to man, it will stick to anything. 20 dollar bills coming out of the Federal Reserve often has enough cocaine on them for a dog to smell, for the same machines that handle new 20 dollar bills, handle older 20 dollar bills that are to be reissued. The older bills have cocaine on them, contaminate the machines, so even newly printed bills have cocaine on them.
When a judge was faced with this fact, he dismissed the confiscation of money on the grounds that so many people would thus have contaminated 20 dollar bills on them (something like 99% of the population), the mere fact a dog could smell the cocaine was NOT probable cause of drug dealing.
Thus when the person arrested is tried at trial, his attorney can ask the handler of the dog if the dog could have acted the way the dog did for anything else then drugs? If the officer lies, that is perjury, if he tells the truth out goes the arrest. It is best to be able to show the Dog has been trained to do the same indication of drugs if shown a hand signal thus catch the officer lying. Most officers do NOT want to lose their job, if caught lying under oath there goes their job, thus most will tell the truth. For those officers who will lie, you have to wait for their lies to catch up with them, then pounce.