Short answer is yes, you can do it. I put a 1350 in an Explorer years ago because it was what I had on hand.
Driveshaft length might be an issue but 1988 would probably have had either an A4LD auto trans or FM-146...both of which are the same length as whatever you have in your Ranger. So "could" be an issue but probably not.
Your rear driveshaft may be an issue too - I am about 99% sure you have different rear yokes on those t-cases. B2 should have a CV yoke, the Ranger probably has a flange. Fortunately you can swap them.
The shifter may or may not work. If you have both shifters, you can make something work. I have run into issues with the bottom part of the shifter itself being the wrong length or angle, and the arm on the t-case itself being too short or too long or bent the wrong way. Hard to say for sure but this is probably the biggest issue you will run into.