Sadly it doesn't seem to work that way. BE/AZERTY keyboards, for instance, have a physical key that US/QWERTY keyboards do not (<>\). The OS will ignore that key unless it's set up to use a layout that includes the key. There is no way to program a QMK keyboard to fix that (unless you change the OS to run the BE layout), because QMK does not map keypresses to characters. It maps keypresses to keycodes, which depend on OS keyboard layouts, specifically US/QWERTY and sometes DVORAK. At least that's how I see it.