5th Edition doesn't really have an official stance on this, but previous editions have.
The 3rd Edition Manual of the Planes has a sidebar on page 44 that discusses this issue, albeit within the context of some specific rules about how clerics worked in that version of the game:
DIVINE SPELLCASTING AND ALTERNATE MATERIAL PLANES
Even if an alternate Material Plane has its own pantheon of deities, divine spellcasters can still gain their spells provided that they have access to their native plane through spells or portals. [...] If a divine spellcaster who receives spells from a deity arrives by interplanar accident, however, the connection may be severed. Such a character might have to locate a new deity that matches up with the alignments and beliefs of his or her old deity before receiving spells again. Certain spells and domains may no longer be available until the switch is made -- and converting to a new faith may not be an easy process.
Alternatively, a cleric cut off from his deity might simply venerate the principles he stands for, connecting to his domains in the same way that clerics unaffiliated with a deity do.
That said, this is 5e, so it's up to the DM to decide what they want to do. As I see it, there are three basic options, of which you might choose one, or mix-and-match various elements of several:
1) Your bond to your deity is stronger than planar or multiversal boundaries.
Even if you go somewhere that your god's influence doesn't normally extend to, as a cleric, you bring your god's influence along with you. This is the easiest option; the cleric doesn't have to be concerned with the technicalities of planar travel. As the above sidebar quote said, this could be related to the presence of portals or other semi-permanent planar connections nearby -- as long as the portal is open, you have contact, but if the door closes, you might be stuck with no powers.
But you could easily just make this ruling without worrying about portals and such; just decide that a cleric can talk to their particular deity no matter what because that's just how it works in your game.
2) Somebody else picks up the slack.
When you arrive in a new multiverse, some other god/entity/philosophical power source becomes your new source of power while you're there based either on your domain choice or some thematic similarity. Shar can't reach you, but instead you start getting power from Nerull or the Raven Queen or The Shadow or just the philosophical concept of darkness itself. This might be just a DM handwave, or it could have some implications on the character, depending on how much you want to get into it as a story element. A connection to a new deity might cause just a mild mystical push to act in ways more associated with the temporary patron, or you might even have a servant of said patron coming to investigate why somebody seems to be drawing their power who isn't properly their cleric. It could be something the gods have kind of agreed to do behind the scenes or a strange effect that surprises them as much as anyone. Or you could decide that the same deities exist in other multiversal worlds under different guises, so the God of Storms in one world presents as the Goddess of Seas in another world but has similar domains and so on -- "You don't recognize me with this face and form, but I know you."
3) You lose your clerical powers, either entirely or partially.
This is probably the worst idea, in my opinion. While you're away from your home multiverse, your powers stop working entirely and you're just a sub-par fighter. This is very likely to feel like you're beating up on Clerics in particular (and, possibly, Paladins), since your fighters, wizards, and bards don't risk losing their powers when they go to a new world.
You could of course mix these to some degree, like allowing the cleric to use cantrips and low level spells due to a sort of accidental connection to a thematically-similar local deity, while restricting access to powerful magic, but that's still likely to feel like you're being mean to one player in specific.
If you wanted to be slightly more egalitarian, you could rule that the cleric's powers are limited, but so are all magic users because arcane and natural magic in this world works a little differently as well. That's still going to sting, but at least it's more "hey Fighter, go be cool" than "welp cleric, you're just gonna suck this time".
It also might depend on the universe you've arrived in. If you pop into Darksun, the fact that clerical magic doesn't work is a pretty big part of the setting, and the Cleric class just doesn't exist there, but arcane magic is also super-restricted. Conversely, Ravnica doesn't have gods as such, and all clerics get their powers from philosophical concepts or the guildpact itself, so there's not much need to spend a ton of effort on converting anything.