This is a typical description of a dog with a reverse sneeze. No one has identified one specific thing that causes this, although there are a number of different triggers that are thought to be involved. In our area, I think most of the dogs I see have some post nasal drip that is probably allergy related which causes the episodes. We tend to have clients report it in clusters, which supports the allergy theory. Also short faced breeds seem to have this problem more frequently, which may be related to a longer soft palate which can become entrapped over the epiglottis and contribute to the problem. In some areas of the country, nasal mites may be a factor but I have not seen this in our area.
Below are a few videos which demonstrate typical reverse sneeze episodes. All dogs are a little different, but if your dog looks like this, seems fine after the episode is over, has pink gums and tongue during the episode, and shows no other evidence of disease, reverse sneeze is the most likely answer. If the problem is frequent or seems to be causing your dog distress, contact your vet to make sure there are no other problems going on. In some cases, antihistamines may help decrease the symptoms. During the episode, sometimes stroking your dog's throat gently or even sticking a finger down his throat may help to stop a prolonged episode, though in most cases the dog is probably best left alone (note- several places on the internet recommend holding the dog's nostrils closed. I would not suggest using this technique).