What parameters determine whether galaxies colliding will result in a merger or a hit and run? Colliding galaxies sometimes merge and sometimes pass through each other. Either way, there are huge changes as a result. What are the parameters that matter in determining whether a collision will result in a merger or a hit and run, or something in between? What will be the result of the Milky Way-Andromeda collision?

Thinking about this some more, I suppose the most clearcut distinctions for the result would be whether the two supermassive black holes end up unbound, bound, or merged. Would it be possible for the bulk of the two galaxies to merge, but one or two of the SMBH's go on their merry way?
The main factor is the velocity of the encounter. The higher the relative velocity between the two galaxies, the easier it is for them to pass through each other without being slowed down enough for a proper merger to take place, and without being strongly distorted by the encounter. (In a very high speed encounter, the two galaxies will spend almost no time close enough for tidal forces to be effective.)

In clusters of galaxies, where the typical velocities are around 1000 km/s, mergers are rare; in small groups, where the velocities are around 100 km/s, mergers are more common. So the Milky Way and Andromeda are pretty much destined to merge.

During a merger it's possible for stars in the outer parts of the galaxies to be ejected by tidal forces, but the central regions of both galaxies should definitely merge. Thus, the supermassive black holes (one in each central region of the original galaxies) will end up in the center, too. (Unless you have something exotic like a merger where one of the galaxies already has an unmarked binary SMBH; then you might get one of the three SMBHs ejected via a 3-body interaction. But I suspect that's pretty unlikely.)