If I flash a custom recovery img, will I be able to boot the normal old system? Can I flash a custom recovery (say, the one from Replicant with heimdall flash --kernel path/to/recovery.img, or ClockWorkMod) and then be able to boot the old system?

Without reinstalling the main OS of my Samsung Galaxy S.

I'm interested in using the commands from the recovery system without re-installing the main system.
I just tried this, going from TWRP and LineageOS flashing the Replicant Bootloader.

First of all you will have to flash it using the command from the replicant guides: https://redmine.replicant.us/projects/replicant/wiki/RecoveryInstallationWithHeimdall#Flash-the-recovery-image (archive)

I won't include the table in that link, this question is not about that, but do note that some devices need you to flash to the BOOT sector of your device. This means you won't be able to boot the previously installed system. Needless to say, I was not able to boot LineageOS going from TWRP to Replicant bootloader.

However, if you were to go from stock to TWRP, most TWRP installation processes do not cause any data loss and will allow you to boot the previously installed system, see for example: How to flash and root OnePlus 3T on Linux? or Rooting already unlock phone without losing data, possible?

However, unlocking a stock bootloader will usually cause the device to factory reset (resulting in data loss), so if you need to unlock to install a custom bootloader you will not be able to boot your previously installed system. See Why does unlocking the bootloader wipe phone?

Upgrading a bootloader usually wont re-lock, or cause data loss. See Does upgrading bootloader wipe your data?