Yes you can run Xcode 14 on Sonoma. Right click the Xcode 14 app icon -> show contents -> browse Contents/MacOS -> Run Xcode
I don't know why Apple puts a stop sign on old Xcode versions when they release a new OS version. Ive been running Xcode 14 since Sonoma came out with no issues. I guess they don't want to spend time supporting older versions if something breaks.
I would suggest you uninstall Xcode from App Store and instead use this excellent app: https://www.xcodes.app
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: