I have worked with K9 units during my tenure in federal LEO. Trained service dogs ignore food on a test subjects or area they are highly trained officers. Only a food trained K9 such as the beagles that CBP uses to find illicit meats, fruits and vegetables in luggage coming in from overseas would alert to food in a pocket all others would ignore it. The hounds group are used for food, explosives, and people(cadaver,medical,survivor in rubble) but not apprehension K9 Shepards are the breed for that line of K9 typically.
There is very little in the way to spoof a well trained K9 the coffee grounds is a myth as is food or bacon or steak.
K9 dogs are amazing.