There are a LOT of military stories told in SF. I’m guilty of writing them. As with romance and mystery, you can tell any sort of story in an SF military context, from exploration to alien invasion to humorous. Military, then is a journey, not a destination, if I may.
Writers should pay attention to details when building their space military or (especially) basing it on something.