In fact, the gun would fire exactly as it would in an atmosphere. Oxygen does not and NEVER HAS played ANY role in the explosion of gunpowder. Black powder - the original form of gunpowder, is a mixture of 3 things - carbon, sulphur, and either sodium or potassium nitrate. Carbon and sulphur are each BEGRUDGINGLY flammable. If you've ever lit a charcoal grill, you know what I mean by begrudgingly. Sulphur is a little less begrudging. But that is what they do in a mere 21% oxygen, diffusely around it at atmospheric pressure. Potassium nitrate takes the place of oxygen. It is an oxidizing agent. Gunpowder is thus a solid MIXTURE of an oxidizing and a reducing agent. Rather like having a tank full of a mixture of oxygen AND hydrogen gas. Or liquified oxygen and hydrogen (VERY bad idea, by the way. Kids, don't try at home). It needs no exterior substances whatsoever. All it needs is a tiny, tiny little excitation and then all hell breaks loose. If you mix hydrogen and fluorine, it doesn't even need to be an actual spark. Just ordinary visible light will do! With gunpowder, it's a little more stable, but the fact is that you have an oxidizing agent AND a reducing agent MIXED together AND in DENSE, SOLID FORM. It is a recipe for disaster and oxygen from air around it plays as much a role in its explosion as Earth's gravity plays a role in the acceleration you feel the moment you crash your car into a steel wall at two hundred miles an hour. In other words, not a lot. With a gun in space, however, you would have a nifty little means of propulsion, within limits. Particularly if you had a LOT of bullets.