I might need a brain transplant after thinking about this question. From a theological perspective, I think it’s safe to say that our bodies matter to God as Jesus was bodily resurrected and promises to raise our bodies up as well. He also calls our bodies temples. So with that being said, I don’t think God would allow us to simply swap bodies via brain or head transplant.
Whether it is logically possible I do not know. But fortunately I think it is impossible from a practical standpoint. I don’t think a brain and body could be perfectly connected. The transplanted brain would be tuned to a different body as it developed in a different body. To me that would be like putting an F150 computer in a Toyota Camry and expecting the Camry to function properly. The Camry would drive so wacky, if at all, due to having a computer tuned for a full size truck with totally different specs and dimensions than a small car. So how could my brain, which grew and developed together with my body, be placed in a totally different body and be expected to function perfectly?