That "Pipe" is conduit. It usually has a coupler screwed onto the end. (Which sits just above the back box) then there is usually a brass bush that screws into the coupler. You undo the bush, which releases the old back box, and install the new box, but the new box will not line up with the old one, you will have to make the hole for the back box bigger. I don't see a brass bush or coupler, must be very old.
Alternatively fit a surface patress over the existing box and put your switch onto this