Mostly related note: the reverse historical practice, explaining traditional gods as long-dehumanized ancient heroes, rulers, and villains, is called
Euhemerism. The discovery of Indo-European deity continuity makes Euhemerus's theories obsolete when it comes to most of the Greek gods (and in his time it was scandalous enough that even the fairly agnostic academic field basically excommunicated him), but it's a popular theory among medieval thinkers. We owe almost everything we know about Norse mythology to it, incidentally - the most literary, lucid, and thorough source on Norse mythology, Snorri Sturlsson, was Catholic and wrote in great detail about pagan practices which, while mainly on the wane, still seemed to pose a 'threat' to the new religious order, and the Euhemerist concept made him comfortable with his work, kept it from being seen as heretical,
and encouraged him to go into heavy detail on concepts which were taken for granted and elided out by writers who actually believed in the Norse pantheon.
One thing that's worth saying is that, as noted earlier, a lot of gods are traceable pretty well to (1) almost timeless reverences of elemental forces or (2) conscious invention by theistic natural philosophers looking to explain previously unexplored parts of the human experience. Hero worship should generally involve demigods, and it should bleed over into regnal apotheosis - in some dwarven cultures, the ruler - and sometimes even his subordinates, all the way down to barons - should have worshippers, and if your fortress is the Mountainhome worship of the god-king would supplement or replace the religion of a
lot of dwarves, and the number of immigrants who move to you for religious reasons should eventually become a majority. And almost every noble ought to worship the King either exclusively or supplementally - nobles without the king as a god should be most other nobles' rival. Heroes should work similarly, although the worshippers would be mainly (A) their profession and/or (B) military, assuming they are.
Hero worship ought to definitely require at least one legendary (ideally well above Legendary-4) mood-qualifying skill. This makes the qualifications for demigodhood fairly steep but readily reachable without turning a dwarf who has spent three whole months pushing an unconnected pump around the next Hercules.