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?