Have a look on xdaforums for your device, there will be guides. With the Samsung for example you have to enable bootloader flashing in existing rom developer options otherwise it will overwrite on a fresh boot. Gxda is a trove of info though
It looks like the native OS will flash the original recovery partition back if you try to boot Android without flashing a custom. ROM.
so if I cannot install lineage on my device (package no longer maintained) and I'm stuck with the native OS, that means I'm also stuck with the original recovery partition and cannot install TWRP?
The same thing can be seen on some MIUI device that i used before. Need to quickly press the recovery keys combination to enter TWRP. Entering recovery command from terminal would directly boot into OS.