Firefox (correctly) uses fontconfig to determine the font properties based on a set of rules, and then falls back to the GNOME settings for any properties that were not determined by fontconfig. This allows you to configure things such as per-font hinting settings etc.
The issue is that we (incorrectly) ship the match-all rules in fontconfig for antialias and hinting settings. This means that the fontconfig settings always override the GNOME settings in Firefox, and is really a bug in our fontconfig package.
This looks like part of the problem that you are seeing.
To fix this, you can do the following:
sudo rm /etc/fonts/conf.d/10-*
Note that /etc/fonts/conf.d just contains a set of symlinks to the full set of configuration files in /etc/fonts/conf.avail. To restore the default configuration in Ubuntu, you can run:
cd /etc/fonts/conf.d
sudo ln -s /etc/fonts/conf.avail/10-antialias.conf
sudo ln -s /etc/fonts/conf.avail/10-hinting.conf
sudo ln -s /etc/fonts/conf.avail/10-hinting-slight.conf
Also, your fonts may look slightly different depending on which build of Firefox you use. The Ubuntu build of Firefox carries a cairo patch to turn on Freetype LCD filtering, which will make its fonts look similar to those of other applications and reduce colour fringing.
The official mozilla.org build does not have this patch, and its fonts will have noticeably more colour fringing compared to fonts in other applications.