sort of like going from a civilian member of an outside border patrol service to the first officer of a Federation Starship. All while skipping Starfleet Academy.
She didn't (she was enrolled in an "accelerated program").
Today's real-world military has different training programs established to suit different needs of different populations (The Academies, Officer Candidate School, Direct Commission Officer School, etc.).
Today's military grants direct commissions to people who have specialized skills that the military needs (Engineers, pharmacists, physicians, attorneys, chaplains, experts in unconventional warfare -- like Seven).
Seven had eighteen years of military experience with the Borg plus four years on Voyager
PLUS her years as a Fenris Ranger. She's an engineer with expertise in Borg tech (it's the reason Picard gave her a Captain's field commission at the end of S2).
IMHC, she was given a direct commission on the basis of her extensive military and technical prowess. She was sent to the Starfleet equivalent of Direct Commission Officer School (DCOS).
Gene Roddenberry modeled Starfleet on the U.S. Navy. The U.S. Navy's DCOS program is where newly-minted direct commission officers go to learn the nuts and bolts of being in the U.S. Navy (history, traditions, protocols, basic seamanship, etc.).
Seven has more than earned a Commander's direct commission. She had the know-how to turn a team composed of a cook and several science/medical officers (including the ship's Doctor!

) into a tactical assault unit.
The U.S. Navy doesn't leave its direct commission officers hanging ... and neither does Starfleet.