The way I imagined magic coming out of DF was:
2 things allow access to deliberate use of magic.
-Powerful beings like gods and demons which have access to magic in accordance with their nature.
-A magical equivalent of a mood in sentient creatures which, when satisfied, granted the power.
Also, I think magical beings, like a creature that can fly without exploiting aerodynamics, should have some physiological tie to their magic, such as a magical organ, or an affinity or favor with some deity that grants them the power.
I agree that it's important to keep a balance between control and chaos when implementing magic, and so its use must be limited and acquisition difficult. At the same time, it's cool to have a society that makes regular use of some minor form of magic and it is simply a staple of their culture.
So since the dawn of time, different people can create shrines and temples, act in accordance with a preferred deity, and so on, and if, let's say, the deity's mood is befitting, a deserving follower might be chosen for a secret knowledge. But there should be some requirements of attributes for knowing and using the secret, and how the magic manifests should also be governed by the attributes.
If, for example, a person learns heat magic from the lava god, and later -with reading and writing, or a high skill in teaching- passes this knowledge on to someone they like and trust, but who has low self control, that person might spontaneously combust.
An unskillful necromancer might make weak, decrepit zombies. Maybe they can only animate mostly intact corpses, or maybe they can only animate small pieces.
For dwarves, I like the idea of magical items and runes rather than spellcasting. Knowledge of magical materials as well as arbitrary imbuing magic on something through some learned secret would be fun. Artifacts should remain random, deliberate use could work for simple stat boosting, making a finished product lighter or heavier than the material would normally permit, making it harder, sharper. But with the required affinity so that it's difficult to make industrial use of it. Maybe an offering or ritual which succeeds if the beseeched god is pleased.
Truly magical artifacts, though, such as a flaming lava whip, or a hammer of preposterous strength, should be a mood thing. And it should have a pretty good chance of having drawbacks. Urist has picked up the super heavy laser edged axe of brain melting, but if he ever drops it he will melt himself. Only binds to wielder after drawing blood, does not melt anyone if not wielded (weapon traps or shotguns)
Proper magicians or sorcerers should be rare, and multidisciplinary use of magic should require extraordinary affinities, books should only pass on knowledge to the extent the writer has the affinity, same as if they are simply copied (which may or may not makes sense, but it seems somewhat more balanced that way) so that, let's say, if a fortress produces a book of knowledge because some guy learned to become a lava dwarf at will or when angered because he brought a glob of molten metal with his bare hands to the shrine, then his book can be used by others with the affinity to do so. In this case, the affinity may be some personality traits like "does not care if things are disorganized" "likes to be warm" and some quantitative magical attributes, like "magical understanding 2" and "magical susceptibility 8" and "Magical control 6" then the guy can learn it too. Maybe based on his personality of "has an eagerness to learn magic."
But then, if someone "has an eagerness to learn magic," finds the book, and tries it out, he melts to his fiery death. Or maybe his hands melt because he was a that bad at it.
So a good magic teacher would have a high stat in "teaching" "judge of character" and the magical affinities. If he was a poor judge of character, he would pick the wrong student, who would melt. And maybe set things on fire, which may or may not be inconvenient.