I have a cheap controller that has 2 modes, xinput and dinput, which automatically gets selected. If I plug it into a Windows PC it gets detected as X input and the controller shows a blue light and everything works including the rumble motors and pressure sensitive triggers. If I connect it to a Linux PC or any Android device via an OTG or if I connect that dongle directly into my Android TV, the controller shows a purple light and it gets detected as D input.
However, there is a small workaround that works for me is that when I connect that dongle into my PC when it is turned off and then I turn it on while the dongle is already connected. The controller shows a blue light and everything works normally. It is not detected as a D input device, it is detected as an X input device and everywhere, including steam, it is detected as an Xbox 360 controller.
This workaround, I did not know before but it is available or written on arch wiki. Here is the link. There is another way to always connect that device as an xinput device rather than relying on turning the PC on or off. It requires sudo permissions but I never got it to work properly, I always have to rely on rebooting the PC.