Would it be true to assume that the mass of a galaxy is approximately the mass of all molecular clouds detected within it, let's say, through CO observations and then converted to H$_2$?
The mass of an average galaxy appears to be totally dominated by dark matter, so your calculation would not give the galaxy mass.
Even if all you wanted was the baryonic (non dark matter) mass then what you suggest will be very much a lower limit. For example you can look at this paper by Chabrier (2001), who estimates that gas forms less than half the baryonic mass in the Milky Way. This fraction will be even lower in elliptical galaxies that are largely gas-free.
I am no expert, but I also think that even the gas component is dominated by ionised and atomic gas where you wouldn't expect to see CO emission and which are better traced by recombination lines or 21cm radiation respectively. In other words, the molecular gas is a fraction of the gas, which is a fraction of the baryonic mass, which is a small fraction of the total mass.
There is an extensive review of the "CO method" by Bolatto et al. (2013). The conclusion appears to be that the molecular gas mass can be estimated to around 30%, but that the conversion factor can depend on the star forming environment and on the metallicty of the gas in poorly understood ways.