Probably you were hearing "velar nasal g" [ŋ], which is an allophone of [g] mainly heard in eastern parts of Japan. In Japanese, [ŋ] and [g] in がぎぐげご are variants (allophones) of the same sound (phoneme), and most people are totally unaware of the difference. If you're not sure what I'm talking about, please read these first:
Many professional announcers, actors and vocalists still actively distinguish them depending on the place of がぎぐげご in a sentence. This fact confuses some foreigners because they can easily notice different native Japanese speakers pronounce がぎぐげご differently. However, they are the same sounds to many average, untrained Japanese speakers like me. Even though you feel "m" or "n" sounds in が/ご, they're が/ご to Japanese ears. (Is your mother language English, by the way?) You'll have to get to used to them.
For more information, read this section on Wikipedia.
When you speak Japanese, it's totally fine to always stick to [g]. Some sources say 80% of the Japanese people do not use [ŋ] at all when they pronounce がぎぐげご in sentences. However, if you seriously want to be a professional announcer of Japanese, there are some rules you have to respect. See the linked article above.
Another example of consonant variation is yotsugana. But remember that most Japanese people are totally unaware of this fact.