There is gravity everywhere, including in space and in a vacuum. Even though space is a vacuum, there is microgravity holding all celestial objects together. If gravity did not exist in the vacuum of space, the moon would no longer orbit the Earth.
Astronauts in the International Space Station appear to be weightless; however, they are not. The astronauts and the ISS are falling toward the Earth, but because of Earth's curves and the speed of the ISS and the astronauts, they never crash into the planet. All objects fall at the same rate inside a vacuum, since there isn't any air resistance to slow them down.