This is a very broad question with many possible answers. If you mean over the history of the universe then there is a gradual, but punctuated increase in overall metal content (elements heavier than helium) as a result of stellar nucleosynthesis.
However, on a more local scale smaller galaxies - particularly dwarf irregular ones tned to be more metal-poor than larger ones. Again, it comes down to stellar nucleosynthesis which has more complex impacts on small galaxies than large. A large (massive) galaxy has a stronger gravitational pull so when massive stars detonate as supernovae the energised and metal-rich gas produced fountains into the halo then back to the disc when it cools. However, less massive galaxies, with a lower gravitational pull cannot retain this as well and most blows off into intergalactic space in a strong wind. This not only holds back their enrichment in metals but can abort, delay or completely abolish further rounds of star fomration - which keeps the galaxy metal poor for longer.
Other galaxies may have their metal-rich gas "polluted" with metal poor gas when smaller galaxies or clouds of gas fall into the disc through mergers.
There's a lot of potential for variation on top of the general metal enrichment that happens over time. I hope that (begins) to answer your question.
In general carbon monoxide will trend with the overall metallicity. However, to add to my answer above, there are differences in iron and oxygen concentration that reflect the different sources of these elements. Primarily, iron is produced in Type Ia supernovae (with a questionable contribution from pair instability supernovae). This takes longer to appear than the oxygen, magnesium and other intermediate mass elements that are produced in larger amounts in core collapse supernovae (from massive stars). Meanwhile most carbon comes from red giants. This tends to mean oxygen is produced earliest followed by carbon then the bulk of the iron. However, this is a generalisation. The halo tends to be the oldest and by definition the most metal-poor; the disc more metal-rich. Variations also occur within the disc. The central regions with the highest escape velocity tend to have the most metals, while the outer parts have experienced less star formation and lose gas more readily through the action of supernovae so are more metal poor.
I would look up the wonderful Ken'ichi Nomoto who has spent a large part of the last 4 decades looking at nucleosynthesis. Notable in his work is a rejection of a prominent role for pair instability supernovae early in the universe's history: the lack of such explosions is evident in the deficiency in iron-group elements in ancient Pop II stars compared with expectation. Recently, Maeder did some nice theoretical work looking at ways around the lack of iron and speculated on the presence of "spinstars" early on in the universe's history. These objects span off much of their mass and avoided pair instability thus avoiding the production of excess iron-group elements.
The composition of the galaxies will depend on the generation of the galaxies as well as the constituent stars in the galaxy. If a galaxy contains huge numbers of high mass stars, then the probability of Supernova explosions in the galaxy will go up, thus filling the galaxy with higher mass elements. Also galaxy mergers may occur and this can also alter the composition of the new galaxy formed as compared to the parent galaxies.
According to the PFO-CFO Theory, all chemical elements for each stellar system are formed by the system-forming star with no fusion reactions and, in the first period of the life of a star, the older is this star, the heavier atoms it forms. You can acquaint yourself with the PFO-CFO Theory and with the mechanisms of element formation through 2010-2015 publications available in my or Elena Kadyshevich pages at the ResearchGate site. This theory is capable of giving the answer to your question.