Navy ranks are used for most of the Science Fiction space stuff. But I think they also do like our real Navy and many of them have Marines onboard as well.
Captain Needa became Admiral Needa in Star Wars using the "choke-out spot promotion" method. But General Veers was in charge of the ground assault like he was in the Marines.
BSG had both Navy and Marine ranks and kinda mixed them on the way down. Admiral, Commander, Colonel, Major, Captain, LT, Engign. Then the Enlisted ranks stuck to Navy ranks of Master Chief on down.
Star Trek was weird. You never really heard of an Enlisted person until they made O'Brien an actual Chief on DS9. (Pretty sure he was holding the rank of Lieutenant when he was operating the transporter on the Enterprise.)
But that's not exactly unusual either. In the U.S. Navy, the enlisted person does the really technical work. But the Navy in other nations, such as South Korea, has the Officers getting all of the technical training and the enlisted person just there to do really menial tasks.
I think Star Trek follows that idea. Example: The Chief Engineer (LCDR LaForge) actually jumping in and repairing the systems while the Chief Engineer (a Commander) on the ship I'm on right now (an Aircraft Carrier, like the current USS ENTERPRISE) would just call some enlisted sailors to repair the problems.