If you’re using X11, I believe this can be done in the Wacom Tablet settings. If you’re on Wayland you don’t have a lot of options (maybe someone here can mention a workaround).
However, we’re working towards support for that which is tracked here: 469232 – Ability to bind mouse click types (left-click, right-click, etc) to drawing tablet pen buttons (it mentions pen buttons, but the same feature can be applied to tablet buttons as well)