Wagner cribbed the plot from Germanic and Scandinavian legend. There aren’t that many plot similarities with Tolkien’s novels - just some general atmosphere.
A documentary I watched recently said that Tolkien was particularly influenced by the Finnish language and their national epic poem, the Kalevala.
Oh yes Wagner used the Legend of the Neibulungen for the Ring. But just very similar to Wagners opera.