I don't know about the fit of this for an M2, but basically something like this works well:
https://www.chewy.com/plush-paws-pro...B&gclsrc=aw.ds
My friend has been using something like this in the back seat of his Tesla when bringing his dog places. With a 2 door car I guess you'll have to pull one end off the headrest to get your boxer in and out, but it is a secure way to protect the rear seats and to give your boxer a reasonably comfortable place to be.