How can a magnetic field produce an emf if the force produced does no work?

In the textbook I'm reading it gives an example of where a person pulls a rectangular wire with a velocity $v$ and the left side of that wire is in a uniform magnetic field. After some calculations, the author states that calculating the emf from the current induced in line $ab$ is equivalent to the work done by the person pulling the wire even though the force of the magnetic field has no effect on the work done by the person and the force exerted by the person has no effect on the emf. How is that the force produced by the magnetic field can produce an emf on line $ab$ if magnetic fields do no work?

Magnetic fields never do work for the simple reason that the magnetic force is perpendicular to the velocity. However when you pull a wire orthogonal in a direction mutually orthogonal to the direction of the wire and orthogonal to the direction of the magnetic field, then there is a magnetic force in the direction of the wire.

And an electromagnetic force in the direction of the wire is exactly what you need to get an EMF.

First, there is a magnetic force on the wire in the magnetic field even if there is no resistor over there in free space. The magnetic force is equal an opposite on the protons and the electrons, the net effect on the protons (and bound electrons) is to stress the wire, and it might get a bit longer because of that. On the electrons, it would actually build up a charge imbalance by pushing the conduction electrons to the ends of the wire (and if you connect that resistor it will actually just act like a battery and there will flow a current around the circuit). Since it acts like the battery, computing $\int (v\times\vec{B})\cdot d \vec{l}$ along the wire in the magnetic field does give you the EMF, because that's the definition of the EMF (force per charge by the battery integrated along the two ends of the battery). So that answers your question:

How is that the force produced by the magnetic field can produce an emf on line ab if magnetic fields do no work?

An EMF is the force per charge of the battery/source integrated along the circuit element from it's two terminals, it isn't defined as the work done, so that's not a problem. If it helps, keep in mind that at a fixed moment the circuit element is pointing one way (and that's the direction you consider for the EMF) and the velocity of the charges is another direction (and that direction is relevant for work done, and that velocity direction is orthogonal to the magnetic force direction).

So the next question.

Why is the work done by pulling the wire equal to the work done by the magnetic force?

It might be easiest to imagine that the forces happen a bit at a time, impulsively. So in a brief period of time, the magnetic force gives an impulse upwards, but the wire is moving, so the electrons on the right part of the wire if they just went straight up would now be further inside the wire. The electrons in the middle of the wire would end up close to the left side of the wire, and the electrons on the left side of the wire would leave the wire.

When you pull the wire you pull the whole thing. The whole lattice of protons is being shifted and they shift the electrons with them because when misaligned they bring them back. You can think of the magnetic force as on it's own polarizing the wire electrically, which normally would draw the two sides (left and right) of the wire together. But the force pulling the right side to the left sides is opposed by the person pulling the wire. How much opposed? Equal and opposite can keep it moving at a steady velocity.

But really, doing all the calculations is the correct way to see what is going on, I'm just showing that it is reasonable.