Most Sonos players can only recognize/hold in memory a single WiFi SSID and password at a time, with the singular exception of the Sonos Move (I think, I don’t own one, so that’s based on what I’ve read, not personal experience.
What I’d recommend, which would probably be easier, is that in one location, you use a ‘wired’ mode, and the other use the WiFi signal. That way, the Sonos speaker will ‘find’ the correct signal to attach to, without having to hold separate SSID’s.
But there’s more around that too. You could easily, for instance, set up your home WiFi to match the SSID and password of the work location, and the Sonos wouldn’t know the difference. Or, for that matter, change the work SSID and password to match your home, something probably harder ;)
If, and I suspect it may be, it is hard for you to wire the speaker with an Ethernet cable at home, you could easily purchase a BOOST to connect to your home router, which would then create the SonosNet signal for your speaker to connect to. Failing to find the work network, it would ‘fail’ over to the SonosNet network. In my mind, this is the easiest, albeit it not cheapest route to go. And the BOOST is relatively inexpensive.
There’s more details about the two kinds of setups in the wired and wireless modes FAQ.