Are there events and/or experiences in our collective memory that when we heard John Williams's score for Star Wars in the '70s made us think "Yeah, that's what space sounds like" ?
Would that music have sounded like space without the context of the Space Race and the Cold War, with the moon landing in everyone's recent memory?
When you listen to Williams' music for Star Wars, much is indebted to Gustav Holst's orchestral suite The Planets, written long before the Space Race. Especially the section Holst titled Mars the War Bringer. Just to illustrate this, someone recently created a Holst soundtrack for the movie: you can look at it here.
Holst is a natural fit for film, being influenced by Wagner and Richard Strauss. Wagner was the first to actually accompany action on stage with music effects- something that we now take very much for granted when we see , say, the famous shower scene in Psycho and hear the screeching violins. Richard Strauss created a programmatic music: he wanted to paint a real narrative with real scenes in sound and music, and pushed an orchestra to deliver the utmost in dynamics and tone colors. So, in picking Holst to imitate, Williams was going for more than just the astrological names.
The other person gave a good connection to Holst's "The Planets," though we should also be aware that Star Wars is "a western in space," and Williams's music also pulls in some tropes from western scores as well, especially something Frank Lehman has called a "Subtonic Half cadence" (bVII-V), which is a hallmark of the spaghetti western film score, and prominently features in Williams's score as, for instance, the basic cadence to the main theme, as well as the rebel fanfare.
But I would also point out that Star Wars has become one of the pillars of modern science fiction, and so in retrospect, a lot of what those movies do, including its score, feel so natural because it had a large hand in establishing many of the tropes of space representation that people are still working with today. In the same way that Zimmer's Pirates score sounds so quintessentially piratey to us today, even though much of the score draws on the same sound world Zimmer used for the distinctly not piratey movie Gladiator. In the same way, if you look at Williams's other scores, say, the score for Indiana Jones, the big melodic themes may be different, but a lot of the generic "filler" score that serves as the backdrop for, say, fight sequences and chase scenes are actually not all that different between the franchises.
Moreover, if we look at other space media of the time, things like 2001: A Space Odyssey, Star Trek: [The Original Series], or Alien, then you will find very different sound worlds in play. (Though, oddly, a sort of "heroic horncall" does seem to be a trope that is present in all but Alien). So it is not clear to me, as a result, that Williams's score is all that spacey, especially when you compare it some quite deliberately spacey like the Star Trek theme, with its theremin-like vocal "wooos" and whatnot. Rather, Williams's score looks that way in retrospect because Star Wars itself has shaped in so many powerful ways how space is represented in Western media.