I think the D30 would be OK on a 4cyl Ranger and no bigger than 33-35" tires.
I would prefer to use an actual Ranger t-case under there myself, except to do that, you'd have to either swap out or tear apart your brand new transmission to mate a 1354 t-case up to it (given those two options, I'd take it apart and swap a 4x4 tailhousing & mainshaft on it, as everything else in there is still new compared to an 11 year old junkyard 4cyl 4x4 manual (the last year it was offered). Of course you'll have no more warranty on it however.
A Samurai t-case isn't going to stand up to pushing the weight of a Ranger though, and I believe Toyotas are all married cases (both are passengerside drop as well (exc Tacomas), which eliminates being able to use the ubiquitous Chrysler Jeep D30s, and would probably require a bunch of exhaust work to clear the driveshaft as well).