Yes, but there are conditions. Fan projects generally get taken down unless you clearly state that the Sonic characters appearing in your game are the property of SEGA. Add that notice and you're on much safer ground.