In California, police dogs are covered as police officers by penal code.
What I was taught in various military survival schools: You can't fool the dog. Powdered tear gas will only delay them. Do your best to get as far away from the trackers as possible.
You can only mess with the dog so much, it's handler is not stupid and will help the dog.
In a military scenario, escape to friendly lines as fast as possible. You can slow them down but only outright killing the dog will stop it. You could of course wound one or the other if the opportunity arises but it puts you at risk. Leaving your weapon as a trap is not a good option. Once enemy forces know you are armed they won't try to capture you as much as kill you. Depending on scenario you may not want a gun with you. "I'm just a college kid out hiking and got lost". " Yes, I am in the military, no I don't have a gun, I'm a clerk or whatever and got lost". The John Wayne, I am tougher than all 12 of you is just movie stuff.
Your unit will know you are missing and will come looking. Escape, evade and resist but above all survive, return home with honor.
If you are running from law enforcement, lay down put your hands behind your head and comply with the handler's commands. Let them arrest you. KEEP YOUR MOUTH SHUT and lawyer up. It beats getting chewed on by the dog and keeps the police from laying lumber on you.