Yes, it can be done, but the answer probably isn't the one you want. We can get electricity from the magnetic field, but we need invest energy equal to what we get out, or a little more to take care or electric resistance and friction.
But Really., A magnetic field alone doesn't create electricity. A changing magnetic field does. The Earth's magnetic field does change a tiny bit but not enough to really generate much. U have to move a conductor at the speed of sound....It sounds impossible ..
Specifically, you can whirl around a "search coil" in the Earth's magnetic field, and extract an induced current due to its motion in a magnetic field. It's a bit like the way an electric generator creates a current from a coil rotating between its pole pieces. Some spinning satellites and space probes have used search coils to observe the ambient magnetic field, or at least its two components perpendicular to the spin axis. But there ain't no such thing as free power from the Earth's magnetic field.
Anyhow, You have to move the inductor in the magnetic field with any other power. The Earth's magnetic field is quite homogeneous over short distances though so the coil would need to move fast and very far to generate much. This would use more energy than it creates (at least on the surface of the Earth).
Is free energy impossible?
I am searching for the answer!!!