These games share an interesting place in their respective franchises. Great games, but not my favorite of the series.
San Andreas was a blast to play, from the story, character customization to, of course, the sheer size of the world. However, that broad scope was often a detriment. I remember having to trek for miles to get somewhere which could be tedious at time. Having to leave Las Venturas to go save my incompetent gang back home got annoying pretty quickly. The soundtrack was great as usual, but a step down from Vice City's.
On to Sonic 3. While the platforming was great, I always felt it was a bit of a step down from Sonic 2. That mainly has to do with the speed, as many new platforming elements kind of took away from it. There were just too many times where you have to stop in order to pulley yourself up. Sonic 2 nailed that sweet spot between speed and platforming, something Sonic 3 (and Sonic & Knuckles for that matter) missed. The soundtrack is the least memorable of the Genesis-era Sonic games. I also have a hatred of the invincible star music in this game as well. Still, the new shield power-ups were great and overall, it's still a fun game.
All and all, it comes down to which one I'd be more eager to replay first and that goes to Sonic 3. As a preference, I prefer platformers to sandbox games anyway. I wouldn't lose any sleep over a GTA victory though.