Any of the firearm types we use now (bolt action, revolver, gas operated, recoil operated, or blowback) would function as expected in vacuum, with two significant caveats. According to "Gun Jesus" (Forgotten Weapons on YouTube), the Soviets sent handguns up with certain space missions, as well as mounting weapons on one of their early space stations. The guns they used appear (from the photos, I haven't seen the video) to be single-shot weapons, like a Soviet version of a Thompson-Center Contender, though from comments I understand they're semi-autos, descended or derived from the Makarov.
First, ammunition will need some level of special production to protect against air trapped inside a metallic cartridge from popping the bullet (or primer, but with less area it's less of a problem) out of the casing, resulting in various kinds of failures.
Second, the weapon itself (specifically the barrel, receiver or frame, and revolver cylinder) will need to be proofed for service in space (among other things, lubricants are likely to be an issue due to evaporation, lack of lubricants more so due to cold welding, and a weapon left in shadow for a prolonged period may reach cryogenic temperatures, which can weaken steel).
As pointed out in comments, if you fire a weapon enough times in rapid succession, the barrel and chamber will get hot -- and in vacuum, you don't have air to carry the heat away, you can only dump excess heat by radiation. I consider this a relatively minor problem, however; the only firearms that routinely have barrel heat issues that affect their regular operation are heavy machine guns (like a Browning M2 .50 caliber), firing large rounds at a high rate for a prolonged time. It's possible to heat up an assault rifle enough to melt or burn the wood or plastic parts, but this typically requires firing multiple full magazines (20 to 30 rounds each) in rapid succession. I wouldn't expect this to be a significantly larger problem in vacuum than at Earth's surface.
Assuming the weapon has been redesigned as necessary to work correctly with lubricant coatings instead of oils and greases, protect against cold welding, and stand up to high pressures at temperatures below 100 Kelvin, and the ammunition treated (likely by crimping both bullet and primer, as is already done for weatherproofing) to stay together in vacuum, then the only other issue is recoil.
This doesn't have to do with the weapon as such -- but a gun is essentially a pulsed rocket, with part of the exhaust being a solid projectile. Each time it's fired, it will push the user backward, and if the line of thrust doesn't go through the shooter's center of mass, it will also cause a spin or tumble (possibly violent enough to be difficult to stabilize with suit jets or similar). The only kind of weapon within our current technology that wouldn't have this problem, however, is a rocket launcher or recoilless -- which means your space troopers might finally provide a market and suitable need for the Gyrojet "rocket pistol" (and its carbine version).