No, Sonic the Hedgehog famously can't swim — and he's genuinely terrified of water. The exact reason has never been fully explained, though fans have their theories: perhaps it's because he can't breathe underwater, or maybe he simply sinks like a stone. It may even just be how he was born.
Interestingly, there's an exception — with a water shield power-up protecting him, Sonic can actually stay submerged for as long as he likes. But without it? Keep the blue blur far away from the deep end.