Question: why can electromagnetic waves travel in a vacuum?
Answer: In theory, an EM wave can travel forever. Because they do not need a medium, EM waves can pass through outer space, which is a near vacuum. Also, because they do not give up energy in traveling, EM waves can cross the great distances that separate stars and galaxies.