Assuming terrestrial-like planets are indeed common – with a silicate mantle surrounding a metallic core – then we can expect that water may be exuded onto their surface during the final stages of magma cooling – or otherwise out-gassed as steam which then cools to fall back to the surface as rain. From there, if the planet is big enough to gravitationally retain a thick atmosphere and is in the temperature zone where water can remain fluid, then you’ve got yourself an exo-ocean.
Meteorites from differentiated objects (i.e. planets or smaller bodies that have differentiated such that, while in a molten state, their heavy elements have sunk to a core displacing lighter elements upwards) have around 3% water content – while some undifferentiated objects (like carbonaceous asteroids) may have more than 20% water content.
Mush these materials together in a planet formation scenario and materials compressed at the centre become hot, causing outgassing of volatiles like carbon dioxide and water. In the early stages of planet formation much of this outgassing may have been lost to space – but as the object approaches planet size, its gravity can hold the outgassed material in place as an atmosphere. And despite the outgassing, hot magma can still retain water content – only exuding it in the final stages of cooling and solidification to form a planet’s crust.
Mathematical modelling suggests that if planets accrete from materials with 1 to 3% water content, liquid water probably exudes onto their surface in the final stages of planet formation – having progressively moved upwards as the planet’s crust solidified from the bottom up.
Even starting with a water content as low as 0.01%, Earth-like planets would still generate an outgassed steam atmosphere that would later rain down as fluid water upon cooling.