No, the complete assembly is not the same or interchangeable. The 28 individual battery modules inside are the only items that are interchangeable (other than some fasteners). The case, wiring, sensors and electronics are not.
IIRC the Gen4 Prius 2 (& Prius 1?) used the same battery modules, but, supposedly, with improved quality nickel. They are currently scrapping my 2017 with only 56,757 miles here in central Virginia. It got totalled in a collision on the passenger side door. No way the battery was affected.