Even if the bellhousing bolts line up, other issues like driveshafts, computer compatibility (especially with automatic transmissions and their control modules), and potentially even the crossmember might prevent a successful swap.
In short: Don't assume compatibility. You'd need to verify the specific transmission part numbers for both trucks and do thorough research to confirm compatibility before attempting the swap. Even then, you might need modifications or adapter parts.