Sound is a compression wave so it needs something to compress. We can hear in air and in water because sound waves have the air and the water to travel through in order to reach our ears. In space there is just a vacuum – no air or anything – so no sound can travel.
Sound travels at different speeds in different materials. It travels much faster in water. Whales communicate across huge distances using songs because sound travels around the oceans so easily.