I'm not sure, but I'm pretty sure the 2.3L 4cyl has a different bell housing pattern, then any of the V6's that would have had a M5OD.
Also, in the Ranger and Explorer, the M5OD that was behind a 4cyl had "shorter" (numerically higher) gearing (I believe 1st, 2nd and 3rd). This makes sense, since a tiny little 4cyl is going to need all the help it can get, in terms of torque multiplication on the bottom end and mid-range. Also, 4cyl engines tend to "live" in higher rpm ranges then 6cyl/8cyl engines anyway. They don't have the displacement, so they have to spin faster to make power.
Both Rangers and Explorers had the M5OD-R1. Later models ('95-up Explorer and '98-up Ranger) had the M5ODR1-HD. This trans has slightly improved internals, to go along with the increased power of the SOHC V6, vs the OHV. They are mostly interchangeable, at least when using the newer trans in an older application. Going the other way is more difficult due to sensor changes that a later vehicle needs, that won't be in the older trans. If you have, or plan to use a manual shift t-case, be aware that the later HD trans no longer has the t-case shifter mounting boss on the extension housing.
2002-03 Explorer had a VERY short run of the M5OD-R4, for the small number of XLS base models ordered with a manual trans. This was the last time that an Explorer could be bought with a stick. M5OD-R4 is a sort of "orphaned" "odd-duck". Forget about using it older Explorer/Rangers. Along with totally different internals, the shifter location has been moved WAY back, to the point that it would totally unusable in older Explorers/Rangers.
M5OD-R2 is the model used in full-size trucks (F-150,etc..) It is physically much bigger then the R1. I think some guys have used them when doing all out off-road builds, but it is not a simple bolt-in. I think you would also have to use a different t-case, and driveshafts, as well as modifying the tunnel/floor of the cab.
http://www.explorerforum.com/forums/showthread.php?t=386928
http://www.therangerstation.com/tech_library/ManualTransmission.shtml
http://www.therangerstation.com/tech_library/index-transmission-transfer-case.shtml
As far as the motor swap, I think its probably a waste of time. Motor swaps should accomplish something to make the vehicle better in some way. Putting a 4cyl into a '98 Explorer will not do that. Ford originally did put a 4cyl into the RANGER, but never the Explorer. Why? The Explorer has always been heavier then the Ranger. A 4cyl just won't do the job. Even in the Ranger, the 4cyl was mostly used in 2wd single cab/short bed models. In other words, the lightest Ranger possible.
Now, granted, you said its a turbo 2.3L, so it will have more power then a n/a 4cyl, but still, unless this is some extreme/wild turbo motor, you'll still have about the same or less power then the stock 4.0L-OHV. And that little motor will have to have the snot beat out of it pretty much all the time, just for normal driving. Hearing it "scream" may be entertaining for a little while, but it will get old real fast. The turbo lag will likely also be horrendous, with such a small motor trying to move a heavy vehicle.
You will also have legal issues, as your '98 Explorer is OBD2. Not only did it never come with a 4cyl turbo motor from the factory, as an option (which makes the swap immediately illegal all by itself), but you would have to have a fully functional OBD2 ecm for the inspection station computer to "talk" to, assuming you could somehow get past the visual portion, passing off that turbo 4cyl as a stock 4.0L. That is highly unlikely as no such combination ever existed. While still not advised, for other reasons, this swap would be easier to "get away with" on an older OBD1 ('95-down) vehicle.
Further, there will be no gain in fuel economy. You would likely get the same or worse as you have now. You're asking a little motor to do a big (ger) motor's job. As I said, you will beating the snot out of it on a regular basis, just to get it moving. It will frequently need to be operated in a "mode" very unfriendly to fuel economy. Putting a smaller motor into a chassis where it will still provide adequate power can give you better fuel economy (ie, replacing the 500ci big block with a 305ci in a daily driven 3,000lb car.), but putting in an undersized, inadequate motor will just work it harder and result in little or no fuel savings.
For the amount of work to make this happen, it just doesn't make sense.
Your best bet is to either fix/rebuild/replace the existing 4.0L-OHV, or do a swap to a 4.0L-SOHC. The SOHC is a much easier swap, will pass inspection, and has noticeably better power and economy then the OHV.
On the other hand, sticking with the OHV, there are things you can do to make it better (more HP and better MPG). An underdrive crank pulley and electric fan (to replace the mechanical clutch fan) are a good place to start. I did both of these mods at the same time and saw and immediate 2-3mpg increase, as well as a noticeable "seat of the pant" power improvement. You can also do a cat-back exhaust, or even headers if you want. If you are going to rebuild the OHV, you can also do a mild cam upgrade (Comp 410), as well as mix and match heads/pistons between various year OHV and SOHC motors to get higher compression and/or better flowing heads.