Being that space is an airless vacuum, you may say that you couldn't because fire can not burn where there is no oxygen, but modern ammunition contains it's own oxidizer, which is a chemical that causes the gunpowder in the rifle to explode. Basically, it is possible without atmospheric pressure but without pressure or gravity what happens after that is different.
Most likely what would happen is the bullet would be propelled out of the barrel but unless you had your back against something or were holding on to something to keep you from flying backward. you would be sent into an endless tumble through space if something didn't stop you or you fired a bullet in the direction you were travelling which would just send you flying back towards where you started flying from.
If I was wrong please correct me I'm just going off of what I know about physics and modern firearms.