They are from two different generations, but since they both use the 4AFE - chances of it working are pretty good. Both share the FWD layout, so the starter boss (starter bump) is on the same side. There is a remote possibility that one will have an extra starter boss, will not affect the overall bolt pattern, but should be addressed on the installation.
More of a concern are the flywheel and clutch - as they are both larger on the 7th gen Corolla compared to the 6th gen Corolla. Not directly interchangeable - but can be "made" to work. As such, I would not consider this a straight bolt on affair. Other than that - they should be pretty close. Same master clutch cylinder, slave cylinder, axle seals, I believe the axles are also the same - though you need to check on that, or it will be a non-starter.