It probably is, but there is a big catch:
Nobody besides the sonos “sees” the music you’re playing. You’re just providing it an url.
VERY theoretically, it could be possible to have a “man-in-the-middle” integration that would intercept the actual sound, analyze it, synchronize lights and forward to the actual media_player/Sonos.
You might want to do a little bit of googling regarding what UPnP is
If you fantasize about doing packet sniffing of the music between your router an the sonos, just forget it
The most realistic way to do it is surely with a project like the one you mentioned, involving an actual microphone to capture the sound.
But maybe I will try using WLED supporting Phillips hue lamps with diyHUE and LedFx to synch the music. Thought there were an out of the box solution for home assistant.