Behind the scenes
While sound can be heard from spaceships in many Star Wars works, in reality, sound waves cannot travel through a vacuum. Nor can seismic waves, though they are shown doing so in Attack of the Clones. Conflicting sources exist as to whether the characters themselves can hear the sounds, or if they can be considered part of the soundtrack and are not diegetic.
A few possible explanations for this exist, some more likely than others: 1 - The sound effects are only for the benefit of those viewing the movie and cannot be heard by the characters. 2 - Enough atmosphere has been released from ships/space stations that space can support sound wave vibrations, but still not life. 3 - Since the stories of Star Wars are told in many cases from a Force-Sensitive perspective, perhaps the ability to "sense" sound vibrations despite vacuum is a component of Force-assisted perception. 4 - It just never occurred to anyone while making the Star Wars films that there is no sound in a vacuum, and it's too late to change it now.
Certain sounds would, of course, be audible. If a ship fired its laser cannons, for instance, the sound of the laser cannon's discharge would be audible to the pilot, as the sound vibrates the chassis of the ship itself as well as the atmosphere within. The same is true if a ship is hit by a weapon or solid object.
Almost all the works of the Star Wars saga.
- Vacuum on Wikipedia