Maybe it's different in the US, but in Europe, all Samsung phones can have their bootloader unlocked via a simple two-step procedure, so end users can flash whatever they like as the OS. They also have all their Linux kernel source code, along with any changes they've made to other open source components, available at https://opensource.samsung.com, so you can build custom kernels if needed, or port drivers to a mainline branch.
I've repurposed an old Galaxy S7 to run as a remote development server, via this method. I have it set up so it's just like logging into any other Linux box.