It might be odd to get your head around, but galaxies can and do collide. But far from an wild party of death, galaxies collisions yield hotbeds for new star formation, leading astronomers to suspect that this not-so-violent event is actually a driving factor behind galactic evolution.
The big question here is how can galaxies collide and not just destroy everything? It helps to think about what a galaxy really is. Every galaxy is made up of some 100 billion stars with planets orbiting their host stars, but those stars are really far apart.
Take the Milky Way for example. We're about here on the edge of a spiral arm called Orion Spur. It looks crowded in our little neighborhood, but our nearest neighbor Alpha Centuri A, is actually 4.3 light years away. So galaxies might full of stars, but those stars are really far apart, meaning the likelihood of two hitting is pretty low. But that doesn't mean nothing happens, because there is stuff in those vast distances.
The "space" between stars is actually full of gas and dust. Within these regions are dense pockets of interstellar material, called molecular clouds, that collapse under their own mass and gravity, forming protostars and eventually new stars. When galaxies collide, it's this material - the interstellar gas and dust - that interacts gravitationally with some neat results.