Depending on your current Windows keyboard layout your AltGr key will translate either to Right Alt + Left Control (e.g. on International US, Russian or Polish Pro layouts), or just to Right Alt (e.g. on English US layout). And as far as I know there is no way on Windows to have AltGr on the international layouts to be distinguished from Right Alt + Left Control simultaneous combination.
But, depending on your needs, you can workaround this with the help of AutoHotKey.
If you use the international layout just to be able to enter a couple of characters like diacritics, then you can switch to the corresponding non-international layout, which does not treat AltGr as Right Alt + Left Control, like English US layout, and just add the AutoHotKey script for the special characters you need. E.g.
>!2::SendInput "{Text}²"
will enter ² when you press Right Alt + 2 on English US layout. The Ctrl+Alt+2 combination will not be affected and will be free for other usage.
If you still need to use your international layout, then you'll need to change the AutoHotKey script above to
<^>!2::SendInput "{Text}²"
^!2::SendInput "^!2"
which will enter ² when you press AltGr + 2 or Left Control + Right Alt + 2, and leave all other Alt + Ctrl + 2 combinations free for use.
Depending on the application, the script above may not work though. E.g., on Google Docs under Chrome, it will always enter ² for any combinations of Alt + Ctrl + 2.
To workaround this, we may use the fact, that AltGr maps to Left Ctrl + Right Alt pressed simultaneously. E.g., even w/o AutoHotKey we can enter comment mode on Google Docs with International US keyboard, if we press down Ctrl then press down M then press down Left Alt and then release the keys. But it's not practical to think in what order to press and release the keys. Instead, we may use AutoHotKey for that and change the second line of the script above:
<^>!2::SendInput "{Text}²"
^!2::SendInput "{RCtrl down}{2 down}{LAlt down}{2 up}{LAlt up}{RCtrl up}"
Sometimes, the problem is the opposite: you want to enter some diacritic with AltGr+XXX combination, but that triggers some action bound to Alt+Ctrl+XXX combination. E.g., on Polish Programmers layout, if you press AltGr+S to enter Ś diacritic, the Windows Snipping Tool pops up instead on Windows 11. And of you have Evernote installed, then pressing AltGr+N to enter Ń diacritic opens Evernote window to create a new note. This is easily fixable with AutoHotKey. E.g., the problems above need only two corresponding lines:
<^>!N::SendInput "{Text}ń"
<^>!S::SendInput "{Text}ś"
After that AltGr+N and AltGr+S will correctly enter the corresponding diacritics, while other Ctrl+Alt+N or Ctrl+Alt+S combinations will trigger the appropriate action, like opening the Snipping Tool or New Note window.
Note, that you need to add only those problematic combinations, no need to enter all the existing diacritics.
As a bonus, here is an interesting history behind the Poland Programmers layout.