Several transmissions were offered in the Ranger over the years. The one common factor is the engine to bellhousing bolt pattern which is identical for all years. The early model manual transmissions have a shorter input shaf with the pilot bearing in the flywheel, while the later years are longer with the bearing in the crankshaft. Of equal concern is the light duty design of the early model, which makes it more vulnerable to breakage. Newer model transmissions use a slave cylinder inside the bellhousing, so you'll need those components and the interconnecting tubing if you elect to swap one in.
Automatics are equally varied.
Units that normally mate to the 4.0 have electronic controls by the engine computer for overdrive and torque convertor lock up. Early trucks use floor shifters, while the explorers and later rangers have column shifters. The fuel system also requires attention. Later models with EFI will be the easiest. All that's necessary is the adaption of the quick-connects for the fuel send and return lines in the engine bay.