IF you can get the device unlocked, you can put a Linux-based OS on it, but actual phone functionality will be very limited.
The
Postmarket OS devices page has three categories: Main, Community, Testing - personally I'd call the third one "In Progress" - and it's this third category that an unlocked
Samsung Galaxy S8 is in - pay attention to the "Features" panel on that page for "Works" and "Broken".