D&D elves are not based on Tolkien but the original sylvan, high, and gray elf fluff was ported in wholesale.
Many of the class restrictions for early d&d such as no elven rangers, half elven clerics, and no dwarf wizards, do seem hemmed in by what we see in Tolkien. There's no logic to them unless you apply Tolkien character themes. Unearthed arcana moved the goal posts to include some more logic and the game pushed outwards ever since. Paladins seem more aligned with Arthurian chivalric tales in 1e.
Cleric magic seems based off numerous religious texts, including classics like Moses parting the red Sea, calling a plague of locusts, killing firstborn children, Jesus healing and raising the dead, feeding the five thousand, walking on water, and so on, but also includes Elrond treating Frodo's poisoned wound. Even the Chariot of Sustarre is from a religious tale.