Under normal conditions, the voltage and current in the line change constantly, but smoothly. The change in current induces a magnetic field. Because the current changes direction 100 or 120 times a second, so does the magnetic field. If things are loose or have the right properties, this changing field will cause resonance and parts can "hum" at that frequency. Magnetostriction is often part of why transformers hum.
When you use a normal household, solid-state dimmer, the voltage and current no longer change smoothly. Instead the line is opened at the same point every cycle. Near full brightness, the line opens very near the zero point. But as the dimmer is lowered, the line opens closer to the peak. This sudden change in current means a stronger magnetic field.
The wikipedia page on dimmers has some mention of it.
When the dimmer is at 50% power the switches are switching their
highest voltage (>325 V in Europe) and the sudden surge of power
causes the coils on the inductor to move, creating buzzing sound
associated with some types of dimmer; this same effect can be heard in
the filaments of the incandescent lamps as "singing".