Even if the physical dimensions seem similar, the internal components and computer integration could cause problems. You'd likely need to check the specific transmission codes (found on a tag on the transmission itself) for both vehicles to see if they're compatible. Even then, professional assessment is recommended.
In short, don't assume compatibility. A mechanic specializing in transmissions should be consulted before attempting this swap to avoid costly mistakes and potential damage.