Keep religion fluid. Have conflicting accounts. Avoid an overarching cosmology.
I would suggest there is a tendency – perhaps a temptation – for DMs to invent a myth cycle which describes the beginning of their world, to detail the role and functions of their deities within it: to invent a cosmology, and then engage in a kind of mythopoeia. This then comes to describe the metaphysical reality of the game world. I submit that this is a mistake.
It’s hard not to blame Tolkien – or rather, his literary emulators – for this trend. Tolkien himself is savvy, and there is the – sometimes tacit, sometimes explicit – notion that the received cosmology which we have is only that one which was moderated by the Elves. It contains elements of unreliable (perhaps alien) narration and maybe we shouldn’t really trust it one hundred percent. Tolkien then refracts this further through the lens of Hobbits (Translations from the Elvish by Bilbo Baggins), and then, implicitly, through himself. It is this untrustworthiness – or rather, the unverifiability – which gives myth its real emotional power.
Deities fragment, syncretize, recombine and die. Mortals may be deified, and deities may be historicized. Mythological figures are very fluid.
E.g.: Ba’al Hadad was a popular storm god in Phoenicia from the Late Bronze Age onwards, and in Ugaritic sources appears as one of the Sons of El, the supreme god of the Canaanite pantheon. Hadad was associated with a mountain (Mount Zaphon), was invoked as a war god, and – most importantly – was linked to fertility and the return of the rains in late summer; his fertility role was mythologized in an annual dying-and-rising cycle. When anthropomorphized, Hadad appeared as a bearded man with bull’s horns and wielding a thunderbolt; often, a bull was used to represent him iconographically. The later Interpretatio Graeca naturally drew an equivalence with Zeus.
El, who was also represented by a bull, and was likewise described as living on a mountain, was, over time, “absorbed” by Ba’al Hadad in the northern Levant. Despite being regarded as the chief of the gods, El was distant, and this pattern of rejecting otiose supreme deities in favor of more glamorous storm gods is rather common. Storm-and-war gods had a more immediate appeal, and their cultic promulgation was invariably linked to dynasties which claimed some descent, special link, or patronage from the warrior-deity. To add insult to El’s injury, Hadad later appropriated El’s consort, Atiratu (Asherah). Hadad’s sister (sometimes sister-wife), Anat, a fierce warrior-goddess, was syncretized with Atiratu to form a composite deity, Atargatis. El and Asherah were subsequently discarded altogether; they were “dead.”
A deity might be superceded as the leader of a pantheon, leaving its status ambiguous. This seems to have happened with the Norse god Tyr, who was originally the same supreme deity as the proto-Indo-European *Dyeus. At some point, Odin assumed the mantle of war and leadership: presumably, this usurpation accompanied the ascendancy of a group who already venerated the one-eyed god. Tyr now had to be described in terms of a new relationship: sometimes as the son of Odin and Jörd, sometimes the son of Hymir; sometimes, Tyr is used as a kenning for Odin himself, but his status is often otherwise uncertain.
Sometimes, deities are “adopted” into pantheons: this may occur during periods of migration or conquest (the deities of the displaced are usually negated, but one or two may endure and be recast in the world-view of the conquerors). Trade may also bring encounters with new cults to the attention of established societies; if the popularity of a new deity grows, it can be incorporated into and harmonized with an existing pantheon – at least to some degree. Dionysus and Heracles are both ancient mythological figures, originally hailing from the Middle East, who were absorbed into the Olympian pantheon. Dionysus always retained an atavistic, ecstatic character incongruent with the other Greek deities. Traces of the Heracles legend – a hero-deity bearing a club, questing for apples, mastering lions and snakes etc – are present in Mesopotamia from the Third Millennium BCE. Heracles – especially in his solarized manifestation – is continuous with Ninurta (->Nimrod), and Shamash (->Samson); they share the same ancient mythic prototype.
D&D tends to have much clearer boundaries, and has less fluid figures. So I would suggest blurring boundaries and liquifying your deities.