Apparently on many Android phones on Android OS 7+ there is no option to change external physical keyboard language/layout without going into device settings.
Is there a good virtual keyboard, which also supports changing layout/language for the attached physical keyboard on wide range of devices?
Solutions that I found:
Dedicated keyboard app for typing with physical keyboard. Popular recommendation is https://play.google.com/store/apps/details?id=com.apedroid.hwkeyboardhelper&hl=ru. There are other options like Logitech Keyboard Plus app on Google Play. This is inconvinient, as you have to switch between input method every time you plug the physical keyboard.
Install two keyboards for every language you want to support. Assign proper layouts for them in the settings. Switch between keyboards with Command + Space. This is a kludge and inconvinience.
A few additional points:
SwiftKey does not support this feature. Changing language with the globe icon does not affect what you type on physical keyboard at the moment of writing this question. See https://support.swiftkey.com/hc/en-us/articles/201591341-How-to-use-SwiftKey-with-physical-external-Bluetooth-keyboards-on-Android . Same with Google Keyboard at least on One Plus 3 and Xiaomi MI5 with latest OS updates.
There are multiple threads suggesting to add several language in physical keyboard settings. However most of them are for Anrdoid 5-6, where keyboard layout switch with Ctrl-Space appeared to be standard feature in most ROMs. It appears that this is no longer the case.