let’s say a cleric is transported from Forgotten Realms to Greyhawk (or any other universe). Does the cleric still have access to the gods (spells etc)? As per long-standing D&D game rules, they can by prayer replenish orizons and spells of 1st through 3rd level. Their prayers won't be answered by replenished spells of higher levels…unless a god of the place they're now in decides for reasons of their own to bestow.#Realmslore
— Ed Greenwood (@TheEdVerse) May 22, 2020
Back in 2nd Ed., I remember reading an article (Dragon magazine?) that described it like this: 1st through 3rd level spells were powered by the Cleric’s own faith, 4th through 6th were powered by a servant of the diety, and 7th level were powered an avatar or direct intervention of the diety. I’ve also read somewhere that a diety of the same portfolio may offer their powers, possibly for a price.