Roscoe, not a smoosh nosed dog, does this a lot. He does the rapid breathing, almost like an asthma attack sound. Very loud gasping. He doesn't look distressed, just mildly irritated. I tried rubbing his throat, but that doesn't help him at all. I did read to pinch their nostrils and force mouth breathing. He's checked out fine at the vets too. It's very scary and like Mahealani said, remaining calm is key. It's not easy to do though! Oh, and also fresh air sometimes helps.
The reason a dog has so many friends is that he wags his tail instead of his tongue.