You won’t explode.
Like any other dust, gunpowder is unpleasant to breathe in. You will cough and sneeze as your body tries to get rid of it.
The charcoal in black powder is not toxic. Sulfur is also fairly safe in the quantities you would inhale. Potassium nitrate is a lung irritant. None of the ingredients would be likely to be fatal if inhaled with a single breath. But it would not be fun.
Modern smokeless powders are not really powders, and are much harder to inhale. Nitrocellulose might give you a headache. Nitroglycerin, on the other hand, affects the blood vessels, dilating them. This lowers blood pressure (which is why people with heart disease take nitroglycerin pills).
In general, I would recommend against inhaling powders of any sort.