Galaxies can collide. In fact, our own milky way is due to a collision with Andromeda galaxy. Not to worry though, this is going to happen in over 4 billion years from now, and even when it happens, galactic distances are so vast that the chances of a star or a planet hitting each other are almost non-existent.