It depends entirely on which Sonic game you mean. Across the main series it never happens, but spin-offs, fan projects and non-canon stories are free to take things in stranger directions.