I had that problem with Galaxo (wont accept google account). Solution: wipe/update/restore Gapps
For genuine firmwares you need to reset phone to factory settings then enter G account data when asked (opening market).
Warning, factory settings wil wipe data on your phone (apps, contacts etc.) but will leave data on internal SD card intact (photos music videos etc.).