Is it possible for an AC generator to actually generate electricity let's say being in a ship orbiting Mars or on the surface of the moon? Does Faraday's principle require the magnetig field of the earth?
Faraday's law is one of Maxwell's equations, which are fundamental. It says that a changing magnetic field produces an electric field, no matter where you are. It works just as well in empty space as it does on the earth; the earth's magnetic field is not needed. A typical generator has its own permanent magnets inside, and they are sufficient.