Yes they use the same trans in the trucks from the factory regardless of OHV or SOHC, 97+
I am putting a 97 OHV engine into a 95 Explorer and I had to purchase a SOHC style flywheel, spacer and bolts. The 97+ OHV engine has the same pattern on the rear of the crank where the flywheel bolts up (8 bolt pattern) This is the same flywheel the SOHC uses, so this tells me they made the change to the 97+ OHV to match the new SOHC.
Now with that said be CAREFUL, even though they are physically the same transmission they may not be controlled by the computer the same.
For example on my 97 5.0L drivetrain the trans has a DTRS (digital trans range sensor) well this 96-97 version of the DTRS sends an analog signal to the computer, where as the 98+ actually is a digital signal. The wiring pins also changed locations slightly in the trans plug.
So just be careful, you may have to use sensors from the 98 trans in your trans to make it function correctly.