I think on the surface it sounds like a dream job, but I think there are aspects that could make it a nightmare too. I would most likey become attached and sending the dog in harms way might be difficult in some situations. Even sniffing out drugs can have potential risks. The dogs get punched, kicked, and much much worse, maybe not all the time, but it happens.
It's not the job for everyone, then again being a Police Officer is not the job for everyone. Yup, it is a very dangerous job for both the handler and the dog. My previous K-9, Boomer was punched and kicked a few times while apprehending suspects. It didn't slow him down or deter, quite the opposite it. It enraged him and he fought harder. That dog stepped up a number of times and took the fight out of some very violent individuals. He certainly saved me from being badly hurt more than once and he actually lessened injuries to suspects by gaining compliance so quickly.
A good K-9 handler absolutely gets attached to their dog. I raised Boomer from a 7 week old pup, trained and donated him to my PD. You don't get much closer to a dog than that. We had some perilous moments together, especially working him on the SWAT team. Part of what made Boomer a great patrol dog and the same with my current dog is their temperament, strength, confidence and ability to react violently when needed with out hesitation. This is why we take so much time to select the right dogs and Lassie would be a terrible patrol dog.
There are risks when searching cars for narcotics, augmented with the opioid epidemic and fentanyl use. We have had Officers OD after searching a car and a tiny amount of fentanyl was in the air. A K-9 could easily be after as well. We rarely use the dogs to search the interiors of cars of suspected Heroin dealers or users.
No doubt the job is dangerous for our K-9's, but they perform a very important role in Police work. The dogs keep us safer and keep our citizens safer too. Utilizing a well trained dogs exceptional sense of smell, hearing and eyesight to our advantage definitely keeps us all safe.