Yes, astronauts do dream while they are in space, just as they do on Earth. Sleep in space is somewhat different due to the microgravity environment, but the sleep cycles, including REMs (the stages of sleep that involve dreaming) remain the same.