Restoring Nexus S to factory everything
As long as you reflash both the boot partition and the system partition it will take you back to a stock version of Android. The kernel is packed in the boot image, so that will overwrite a custom one, but a system image alone will not.

You could also choose to flash back to a stock recovery, but that has no real bearing on the Android system itself and custom recoveries are much more robust, so I would personally not recommend reflashing recovery.