Are the galaxies in the universe moving through space?
No, the galaxies sit more or less passively in the space around them. But not too much. As the space between galaxies expands, it carries the galaxies further apart - like raisns in an expanding dough.
But I heard that our Milky way galaxy may one day collide with a neighboring galaxy. If galaxies are moving apart from each other, how can they collide?
Well, the universe is a chaotic place, and the gravity from one galaxy, or from a group of galaxies, may disturb the motion of its near neighbors, causing them to collide. However, on average, when you compare two large enough chunks of space, the galaxies in one are moving away from the galaxies in the other.
Wow, you're really informative. Thanks a lot.
You're welcome.