Is it safe to plug an SD card or USB flash drive in my sytem if I turn the write protection on using the switch?

I know that plugging in some random SD card or USB drive in a system can be a bad idea because you may get malware on your system. Now imagine you found a storage device either a memory card or flashdrive, you want to check it’s contents without having to worry about being infected, now you look at the device and sees it has a write protection switch, so you move it to turn it on and the storage media is now read only.

Now does that mean malware can’t spread from it, can the malware bypass that protection?

Also I know it prevents the system from accessing the storage media, but I’m not sure if it prevents the storage media from accessing the sytem.