About all ST and SW have in common is that they are examples of storytelling in an interstellar milieu in which FTL transportation and communication, and sentient life coming in every imaginable shape, are facts of life.
But ST is about people on a mission to explore strange new worlds, seek out new life and new civilizations, and boldly go where none have gone before. Whereas SW is about a moderate libertarian-populist faction involved in a protracted conflict with a totalitarian-elitist-racist faction. (And Cattlecar Gigantica, and probably also Lost in Space are about humans on the run -- yes, even though VOY was also about people on the run, in the form of a Federation/Maquis crew stuck in a remote part of the Galaxy, trying to get home, it was still about people who rarely forgot that they were explorers first, last, and always.
It's not about the setting; that's only a tool of the storyteller. It's about the kind of story being told. (Which is to say that WKRP in Cincinnati would have worked, albeit with a different look, sound, and feel, if it were set in a country-western station, or even a classical station.)