I think it's more a juxtaposition of themes than direct links. Heavy metal delved deep into fantasy imagery at the time, with Frazetta and Vallejo gracing album covers, and songs were often written around themes derived from many of the same books that inspired Dungeons & Dragons. Michael Moorcock was a fixture of the Brit rock scene, and even wrote heavy metal songs. Even scifi got in on the action...Jefferson Airplane wrote songs based on Robert Heinlein stories (turns out they were mutual fans).
Fantasy art of the 70's also had a very counterculture vibe...with the rise of Heavy Metal magazine, introducing America to the French comic art scene, and some of the best, and trippiest book cover art, ever produced.
So if you were headbanger, odds are you also dug fantasy, and hey look, here's this game that lets you do the stuff you read about and fantasize while listening to Blue Oyster Cult riffs. It was just all a reinforcing circle of influences.
Magic.
The fact that various TV preachers were claiming both were devil worship probably helped with the crossover aesthetic too.