On my desktop system, I have the Logitech Ultra X Cordless Desktop keyboard and mouse bundle. After installing Ubuntu, the mouse's scrollwheel worked OK, but the thumb-buttons that are configured on Windows as back and forward buttons (in a browser) didn't work. While there seem to be plenty of 'how-to' guides around for configuring the extra buttons on a Microsoft IntelliMouse, there don't seem to be any for this specific mouse. The steps below will allow you to configure these two thumb buttons to provide back & forward actions in Firefox.
sudo vi /etc/X11/xorg.conf
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection
This configuration will not allow the thumb buttons to work (I couldn't get it to anyway).
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "Emulate3Buttons" "false"
Option "Buttons" "9"
Option "ZAxisMapping" "4 5 6 7"
EndSection
sudo vi /etc/X11/Xsession.d/57xmodmap
#/bin/bash
xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"
This how-to assumes that you are using standard Gnome-based Ubuntu (i.e.: what you get after doing a standard installation). It should work with other Ubuntu derivatives such as Kubuntu or Xubuntu, as all changes are to X server settings and not Gnome-specific.