In my universe, there are two ocean-based planets floating in space. I would like to merge them together in a realistic way. What kind of event could cause the planets to merge into a bigger one? (Sorry for bad English)
The biggest problem with merging two planets like this is explaining why they haven't already merged long ago.
For a planet to maintain liquid water on its surface it needs to orbit in the habitable zone around its star. This zone is fairly narrow, which means that any planet that is constantly inside it must have a fairly stable orbit. Two planets in stable orbits in the same plane are not going to collide because they are tracing out a path that they have already done before - if they could collide they would have already done so long ago.
The only exception I could think of would be if the two planets had almost but not completely identical periods (on the order of a tenth of a billionth of a revolution, then two planets that started on opposite sides of a star would eventually meet. This plan still has problems though, as the two planets will start pulling on each other as they get close together, causing all sorts of orbital complications.
The only other idea I could find would be if the two planets were orbiting around a mutual barycenter and then had their orbits perturbed by a passing comet or other interstellar traveler.
Beyond all of that, I have no idea if such a merging could work, but it would have to happen very slowly to keep the planets from splashing into space.
I suppose you don't mean that they just collide causing intense damage, I think you mean a 'low-damage' merging. Otherwise, the collision will release so much energy that the oceans would evaporate.
If so, I can only think of binary planets, which are rotating around each other for millions of years. They are losing rotational energy (don't know if this is the correct term for this) through tidal forces. Therefore, they slowly lose distance. This would, of course, take a VERY long time.
I don't know if this is realistic and even possible with real-world physics.
The funny thing about this is the near-zero gravity in the area where both planets are face-to-face. This could create a shared ocean.
In the world of news and police work, they tell you, "Follow the money" In any physics problem, "Follow the energy."
For earth, once you are in orbit, you are half way to anywhere. The energy to get a spacecraft to an arbitrary point between roughly the orbit of Venus and the orbit of Mars is only about twice what it takes to get to orbit.
7 km per second to orbit. $ E=mv^2/2$ So for 1 kg it's 25 megajoules. Half a dozen kilowatt hours.
Still, this is just floating numbers. More meaningful if we connect it to something. Energy usually ends up as heat. The heat of fusion of basalt rock is around 600 kJ/kg Iron is around 150 kJ/kg and we're talking about 25,000 kJ/kg, and indeed one of the problems of orbiting anything is getting it back down unroasted. (This is usually done by heating up a long column of air. Works ok for a tiny shuttle and big ocean of air. Doesn't scale up to planets.)
Any process that merges two planets has to get rid of enough energy to boil a lot of the rock of the planets. This is an 'Everyone Dies' scenario