Apple only lets you downgrade to iOS versions that are still signed. Typically previous updates remain signed for ~1 month. You can check which updates are still signed here: https://appledb.dev/
However, you can downgrade to any previous iOS version if a bootrom exploit is found for your device.