A:Answer Yes, the cable will fit into both the Galaxy S8 and the Nintendo switch.
The question is more of the other end that you are plugging into. You will need to look at the output information on the power adapter to see that it matches the needs of the device in question. The Nintendo Switch in order to get full capability out of it needs 15 VDC at 2.6 Amps which comes out to 39 Watts. The Galaxy S8 needs 5 VDC to charge and the amperage will affect how fast your device charges. I.E. the Samsung Fast Charge adapter that comes in the box can output 15 Watts, which would equate to 5 VDC at 3.0 Amps, to allow you to charge your phone in a little over an hour, however if you plug into a cheaper adapter such as the generic ones sold at most stores and gas stations which only outputs 5 Watts, 5 VDC at around 1.0 Amps, you will notice your phone charges a lot slower.
So to sum up, yes this cable is capable of charging your phone and Switch as long as the power supply is also capable.