What about software that uses those buttons? I.e. web browser? (middle click = open link in a tab, side buttons = forward/back history)

No software I use, uses these buttons for anything integral by default, neither on Linux nor Mac. And if they do, the OS has precedence. On macOS I use BetterTouchTool for those mapping, you can define exceptions for individual apps.