This is a congenital defect in some of the short nosed dogs e.g. Pekingese, Bulldogs, Boxers where the opening to the nostrils is too small. Affected dogs have trouble getting air into their lungs and often make a reverse snort type of sound. Left untreated, it can lead to other problems in the back of the throat or even the lungs.
It is treated by surgically removing a wedge of nostril from the outside surface and stitching the gap closed. This opens up the nostril- a bit like having the tape applied across the bridge of your nose for running.
There is a quick recovery from surgery and immediate alleviation of symptoms.