Any explosives, from black powder to TNT to high-strength military explosives are made with two chemical components, fuel part and oxygen generation part. Gun powder is close to black powder. Therefore, it does not need oxygen to present in the atmosphere for these explosives to work. In the outer space, since the air is very thin, air resistance to the bullets will be much lower than that near the earth surface. The guns should work even better than on surface.