As far as i know, sim unlocking has nothing to do with the firmware (rom,os) running (atleast for most phones). If you are on some custom rom like cm11, better to flash stock firmware and then sim unlock. Also, I thought moto g is sold unlocked worldwide? I know some are, like verizon(cdma). Most of them are cdma ones.