Additional SQL Server features and topics not covered by specific categories
I disagree with Bruce. I am under the belief that if you have a valid SQL 2022 license, you are entitled to downgrade it to a lower version.
Bruce may be correct on the licence key, though. If you have a license key for SQL 2022, the SQL 2017 media will barf at at. But if the SQL 2017 media is pre-pidded, you will be fine.
Overall, for authoritative answers on licensing, you need to contact your Microsoft representative. This is a technical forum, and techies are not experts on the legalese.