Sounds like an OS issue to me from the way you're describing it. Basically, the OS of the Android is able to detect the Apple earphones, but not the other brands. Either the Moto G is telling you it loves Apple products, or the Android OS can't recognize the other earplugs for some reason.
One thing I would try is to gather more information. Try to see if this issue also affects Bluetooth devices. Also try to see if auxiliary cables are affected as well.
Depending on the results you get from all of these tests, I would try one of two things: either a factory reset of the device, or to replace the device via the manufacturer warranty if it still applies. I honestly doubt this is a physical damage issue, as the headphone jack DOES work, just that it's picky with what it works with. Also, you might want to check if your liquid damage indicator has gone off. You can do a Google search with your device model and Liquid Damage Indicator typed next to it and find some pictures or a Youtube video showing where to find them.