Hello @DivineKlein, thank you for getting in touch.
The officially supported controllers for the game include >>
• Mouse and keyboard.
• Dualshock 4 Controller.
• Xbox One Controller.
• XInput compatible gamepads.
• DirectInput compatible gamepads.
Whilst in-game, if you hover your mouse over the top right of the Trackmania screen it should reveal a hidden menu, if you click on the cog and go into settings, select the Input tab, then please make sure you switch the input from keyboard and mouse to your gamepad or Xinput.
You should then be able to scroll down these options and bind your buttons and the R2 L2 buttons should be able to be used as accelerate and brake.
In case of interference, make sure you close any other programs that may be running in the background, other than the game, that could be interfering with your controls, such as other game launchers etc