I hear second time about issues with L2/R2 and hope, I will fix that in next version. I dont understand why it works for some devices and for some yes.
How works gamepad in dos:
First, I recommend my youtube channel. You can find there many useful videos, include joystick usage. But here is quick explanation.
You can control dos game with keyboard, mouse and gamepad. Mapper in magic dosbox is universal and can emulate all three devices. You can bind keyboard keys, mouse and native joystick functions. Not all games support native joystick, they can support only keyboard. In this case you bind keyboard keys. Or they have mixed mode keyboard+native joystick.
How to setup. I think for keyboard and mouse it is understable. Native joystick must be enabled first in game profile at beginning – because games usually detects joystick at startup
Then in mapper bind open gamepad buttons and add your buttons of your gamepad to list. Then press added button and configure it to joystick button(you can bind it to keyaboard, mouse button, etc)
Mapper configuration is per profile, you cant check it globally, but you can duplicate profile. And maybe I can add import mapper from anothet profile in one of next versions