While in game terms, there is nothing stopping this from happening, in story terms, it probably shouldn't be allowed. The reason for this is because divine magic is only granted to the most devoted and the most faithful. When your faith waivers, so does the magic. Any god has the right to restrict spells and even remove spell casting abilities all together from their followers or worse, place some sort of curse on them.
Warlocks make pacts with entities that are not gods, and because of this, the magic is not divine. The creature may be as powerful as a god, (demonlord, dead god, primordial) or a lesser power (archfey, devil, angel, aberration, lich), bit whatever the case, when the contract has been made and the pact has been set, the entity binds a piece of it to the soul of the individual. This pact can never be broken and the bind can never be undone (except maybe by a wish). And while selling your soul may not have to be part of the bargain in the pact, your soul will forever be stained, and your god may never want you. While there are exceptions to this rule, the player and the DM should hash those exceptions out. Like maybe an Oath of Ancients paladin makes a pact with an Archfey and is granted powers because the Archfey's motives are in line with the nature god he serves and was granted permission (perhaps even a minion of the god, that the paladin saves).
Warlocks make pacts with entities that are not gods, and because of this, the magic is not divine. The creature may be as powerful as a god, (demonlord, dead god, primordial) or a lesser power (archfey, devil, angel, aberration, lich), bit whatever the case, when the contract has been made and the pact has been set, the entity binds a piece of it to the soul of the individual. This pact can never be broken and the bind can never be undone (except maybe by a wish). And while selling your soul may not have to be part of the bargain in the pact, your soul will forever be stained, and your god may never want you. While there are exceptions to this rule, the player and the DM should hash those exceptions out. Like maybe an Oath of Ancients paladin makes a pact with an Archfey and is granted powers because the Archfey's motives are in line with the nature god he serves and was granted permission (perhaps even a minion of the god, that the paladin saves).