Can an unlocked gsm iphone 8+ work with sprint?
I believe the 6s and higher unlocked work with either but you can look it up in Sprint website and the Sprint store likely has a SIM card to test compatibility https://www.sprint.com/en/shop/bring-your-phone-to-sprint.html I believe they had the same hardware as the SIM free that started they year.
On GSM? No. Sprint 3G was CDMA - like Verizon. It can work on LTE... and provide voice service using VoLTE. The bigger question is whether Sprint will allow that phone on their network - and Sprint customer service can answer that.
iphone 9 yes