One of my tablets is an Amazon device which stopped getting updates to Amazon's proprietary Android 5-based OS. But it runs Android 10-derived LineageOS just fine. A relative was just going to throw it out because the software was out of date. The amount of e-waste produced due to this practice must be scandalous.
Purely in terms of specs and performance, most devices since about 2017 can run the latest software. Manufacturers rarely support the device for more than a year or two, though. This pattern of behaviour goes all the way back to the very first Android device. The HTC Dream was dropped after Android 1.6 but it can run later versions.