It's not easy for me (native speaker) to distill the general rule. But, as a matter of fact:
¿Cómo hacen todo?
and
¿Cómo lo hacen?
would be correct constructions, though they would be slightly different questions. In the later, "lo", of course alludes to the thing that is being done ("todo" - direct object - you can try replacing it by "el trabajo"), which here is left tacit; hence, this would only make sense if the previous sentence or the context had mentioned that, eg: "-Siempre hacen todo de la misma manera. -¿Cómo lo hacen?"
So, your book/teacher is right.
To say
¿Cómo lo hacen todo?
would be a redundant construction (see that it's a merge of the two above). Incorrect, but it might happen in casual speaking, perhaps for some emphasis.
¿Como todo lo hacen?
would be definitely wrong, that's never the order.