Describe what the dog sounds like when it has "an attack" is it kind of a coughing, honking noise? If so, it is from a callapsing trachea. Many dogs have this problem. They can live fine with it, but if it starts happening real often, the vet can give you meds to help control it. Let me know, I'll try to help, worked as a vet tech for 10 years!
My dog had a problem like this, got to the point where she couldn't even play outside, as soon as she would try to run she would start kind of coughing/sneezing. Found out she was allergic to a cat we had brought home shortly before she started acting this way. It started with a cough, turned into coughing fits, asthma type reaction. She is fine now, had to get rid of the cat.
When I took her to the vet they did check her trachea, it was fine, and they were going to test her heart next. Boxers are known for heart problems. But it ended up being the cat
Dogs can have athsma. Its an autoimmune disorder so it is caused by food allergies. We are trying to get our horse allergy tested but no one tests food.
Boy it is hard to describe, it's not a cough....she opens her mouth and it's like she is trying to get air. She stands real stiff or will walk over to me and she sounds horrible, loud enough to wake us up.
If I rub her throat or hold her mouth open wider it seems to help get her breathing back to normal.
She's a beagle and is overweight, had her thyroid tested and nothing, she eats very small portions twice a day and has NO table scraps.
Our horse has allergy's in the spring, summer and fall. He coughs and sneezes, some days more than others. Some days his eyes run. I wash him down nearly everyday to help keep the pollen off of him.
It doesn't phase him at all, he still feels good most days.
Ah! I bet your dog is "reverse sneezing". It is very common in beagles (and other small dogs) although any dog can do it. It is really alarming, but usually not harmful.
Happy to help!! If you do a google search on "reverse sneezing" you can get plenty of information about it. I have had many, many beagles come through my classes that do this.