The wiki description of the phenomenon [1] covers that using earplugs doesn't reduce the sensation. Hence I don't see how cancelling headphones would be different — if the sensation isn't direct audio then it wouldn't be caught.
Active noise cancelling headphones are, in my experience, much more effective at cancelling continuous low-frequency sounds than earplugs which only attempt to block them.
On the other hand, if “the hum” is at frequencies that are normally too low to be heard by most of us, then they may be also too low to be recognised by noise cancellation hardware.
A range of frequencies are given in the Wikipedia link for the phenomenon, in various different cities, and some of them should certainly be within the normal, cancellable range.
I too suffer from a "hum", but in my case it has a clear explanation: a noisy ventilation fan on the roof of my building, right above my bedroom.
Admittedly, headphones can be a bit uncomfortable when you wake up with them still on your head, but the feeling of silence and being able to get to sleep easily is priceless by comparison.
Perhaps someday, someone will develop noise cancelling earbuds that can be comfortably worn while sleeping, even if you roll over?