Most android games support standard HID (Human Interface Device) Bluetooth controllers, so as long as your controller follows that profile, it should work automatically.
For games that don’t have native controller support, you can use key-mapping apps or built-in features on some phones (like Samsung Game Launcher or Xiaomi Game Turbo) to map buttons manually.
There’s no universal solution that forces controller compatibility with every game — it depends on how each developer codes input support.