Hello,
It depends on what type of product key it is, and what version of Windows you are trying to activate.
You can use a Windows 10 key for Windows 11, and vice versa. However, you cannot use Windows 10/11 keys to activate older versions, for example Windows XP, Vista, 7, 8/8.1, etc.
Hope this helps.