Selectable CAN bus split termination
There should be no problem passing the CAN signal through a switch, you don't need the complexity and cost of the optos if you are not driving it from a logic source. The switch should be a signal (not power rated) switch, with gold contacts for low resistance at low currents and voltages. I don't see why you need DPDT, DPST is sufficient, and more commonly available e.g. as DIP switches.

There is some advantage in the second schematic with optos - you could feed both opto LEDs from the same SPST switch, which simplifies the switch requirement. Another improvement would be to series the opto LEDs and recalculate the 720R resistor for that, saving 3mA from your 3.3V supply.