Most big budget games (those with an international distributor) will work out of the box, using ZQSD instead of WASD for azerty layouts. A decent game will also introduce the layout in the first level, others will let the player discover it through the customisation screen. The implementation strategy can be detected by asking the OS to switch layouts. Either the game uses scancodes (positions) internally, and maps them to keycodes (symbols) when showing configuration dialogs and prompts; or it uses keycodes internally, and detects the layout at startup or on first launch.
The first strategy (scancodes internally) is more robust, but does require a bit of care to prevent the abstraction from leaking through. Remember to remap scancodes to keycodes when presenting keys to the user (in tutorials, prompts and customisation dialogs). You will still need to look at keycodes when taking text input (letting a player type their name for example). If you need to handle more text than that, look at using the platform's text input support, which is outside the purview of a game engine (handles dead keys, capslock, copy-pasting, advanced input methods…).
When porting a game that never used scancodes (which is not the case with a decent engine, since scancodes are also closer to the hardware and faster), the other strategy might be more practical. You can map scancodes to keycodes using SDL2 functions SDL_GetKeyFromScancode and SDL_GetScancodeFromKey, or platform-specific equivalents. If you also use the SDL2 event loop, those functions will remain accurate across layout switches. Avoid functions like GetKeyboardLayout() on Windows; there is no guarantee that you'll be able to find the layout in a known list.