There are lots of effects where an electrical interaction causes sound. Lightning is one example, where you heat the surrounding air and get thunder. Any spark will give a similar effect.
AC in a transformer causes the domains in the core to continually change direction, and the iron actually expands and contracts slightly as this occurs, so you get a humming.
A rapid shutoff of current that creates a magnetic field will often give a large back-emf from Faraday's/Lenz's laws. This, I think, can also cause noises.