Yes! They should be interchangeable.
The board is exactly the same size, the connectors are at the same location, The cables and major parts Battery, Display & SSD are all the same.
Apple sometimes does a model ID change just because of the change out of the CPU as Apple went to a newer version in the 2017
Apple did the same thing between the 2011/12 15” Unibody MacBook Pro.
I can’t think of anything that would stop you. But, I haven’t tried either. Let us know how it goes.