If both engines are available in that truck, then, yes, it's theoretically possible.
Money-wise, that would be something I'd only do in my own backyard, with a complete donor truck in my possession.
It would probably involve the entire drivetrain. Engine, transmission, wiring, driveshafts, maybe even the rear axle if you don't want to blow it up
