You should be able to use wired gamepads and keyboards using an OTG cable but I have not personally tested this. Search on Google for How to Connect a Controller to an Android Phone or Tablet or perform a similar search.
I highly recommend 8BitDo controllers as they are versatile (Can be used with Windows, Nintendo Switch, MacOS and Android) and reasonably priced.