It depends on magic, dragon biology, wight magic and wight biology, none of which is explained, so we don't really know.
I think you are thinking of dragons as having an internal furnace and bellowing out flames. One possible alternative would be if dragons instead had glands. There are volatile chemicals that react violently when they come into contact with, say, water. There are also "binary" chemicals that are relatively inert, but react violently when joined together.
YouTube - Potassium in water
If a dragon had glands and their "fire" was a fluid that was explosively combustible when exposed to oxygen, then it would safely reside in the glands until spewed out by the dragon, so it wouldn't be containing "fire" on the inside.
Using the binary chemical model, if the dragon had two separate glands, and spewed forth each one from a different opening, then they'd only burst into flames as they mixed, after being spit out and away from the dragon.