Earplugs only make it worse, because they filter out ambient noise that otherwise helps distract you from the incessant hum. Daytime is not as bad as night because of the natural activity sounds of a city.
I have read that waves and underwater currents hitting the shore (or below the shore) can cause vibrations that will translate through the earth. That could be a cause of such sounds in some parts of the world.
When I lived in the mountains of Colorado, with few people around and no industrial equipment anywhere, this hum would come and go and drive me nuts at night. I finally came to the theory that it was certain wind conditions going over the mountain ridge (across the valley), creating a pressure differential on the other side of the ridge. After the differential would reach a certain threshold, the air pattern would break up and create a pooof. This is sort of like if you are sitting in front of a campfire and the flame is going mostly on just one side of a log, but every second or so it breaks around both sides. The sound is identical, but singular. Although if it happens at a fast enough rhythm, it becomes a frequency that sounds very similar to a "hum". Of course the fire burns the wood and the conditions that make that happen change soon.
I have wondered what kind of measurement equipment it would take to try to identify the source... triangulate it somehow. I really wish I knew the definitive answers to some of these hums.