Rebuilding an engine without removing it from the car or truck or other vehicle could be done but it would require much more work to rebuild the engine with the engine still in the vehicle than it would be if you just pulled the engine from the vehicle and rebuilt the engine on an engine stand.
To rebuild an engine you need to tear the engine completely down and remove the crankshaft, camshaft etc which would be almost impossible or at least a very aggravating experience with it still in the vehicle.
It's easier to just remove the engine from the vehicle and then put the engine on an engine stand and rebuild the engine that way.
You'll save time by removing the engine and rebuilding it and then put it back in and the process will be much easier.