I think most dog owners are familiar with the term "kennel cough". We are mostly familiar, because before we board our dogs, or let them play at day care, we need to get them vaccinated against it. The vaccination is called Bordetella, and it is named precisely after the bacteria which causes it.
Your friend can contract Bordetella not unlike how we contract a cold. Someone sneezing in our faces, sharing a glass of water with our cootie friend, using a pen after someone wiped their nose and wrote with it. Your pet can share his glorious spit with a buddy during play and come down with the bacterial infection. But think of it like a cold.. we don't all *get* something due to exposure, but we are at risk.
The myth about this infection, is that "kennel cough" describes all things which cause respiratory distress in our friends. The reality is, is that there are thousands of viruses, bacteria, and fungi which can enter their respiratory tract and cause comparable symptoms. Kennel cough merely suggests infection of the Bordetella bacterium specifically.
While you can take your dog to the vet and treat this bacterial infection with anti-biotics and such, it doesn't mean that your dog's Bordetella vaccination didn't work. Many owners return from day care, their dog gets sniffles in a week, and they assume it's kennel cough. It could be any number of other nasty critters which can be passed to our dogs from other dogs. So.. they didn't contract Bordetella, they got something else. (with extreme, especially prolonged coughing, always see a vet).
Kennel cough isn't serious on the whole, and untreated it can go away by itself. This is not to say that what I've learned in school should ever replace the sound advice of your vet. I had a foster dog, diagnosed with kennel cough, who was anorexic and extremely lethargic. For her, it was likely her condition progressed to pneumonia before I had her, or it was something altogether different such as Canine Influenza. I will never be sure, but she certainly was on anti-biotics. Even if your vet suspects it's a viral infection, they may still prescribe anti-biotics to ward off any potential secondary viral infections while your dog's immune system is compromised.
Bordetella, like most bacterial infections, is contagious. If you are a big-hearted person who takes dogs into your home, beware the signs of coughing and runny noses. Isolate that dog until they can be checked out by a veterinarian. No owner should ever diagnose their pets, and no one should ever read anything and take it as gospel over the sound advice of your doc!