As the galaxies get closer to each other, they can collide. But as you can see by observing the stars near the Sun and the other galaxies with the telescope, there is a lot of empty space between the stars and even more between the galaxies. Also, when they collide, there is no impact, no explosion because the stars pass very far from each other. In fact it’s as if you mix cold air with hot air or milk with choco: you do not hear an explosion in your glass and yet the two materials are well mixed! It happens exactly the same thing with galaxies.
On the other hand, because of their gravitational force, the trajectories of the stars are strongly disturbed when they pass close to each other. Since a galaxy is very large and contains many stars, the two galaxies will deform for over a billion years before fusing together and take another form.
Sometimes, if the galaxies collide gently, they deform little and retain their spiral shape after the collision, but sometimes they are unrecognizable and irregular in shape, their spiral arms moving far into space while their nucleus surrounded by very tormented gas clouds, throwing arms and jets of matter in all directions.
The universe is not limited to stars and galaxies. It contains many other objects that look like galaxies but that shine much stronger or emit radio waves, X-rays or gamma much more intense: these are the quasars.