Recent theoretical works claim that high-mass X-ray binaries (HMXBs) could have been important sources of energy feedback into the interstellar and intergalactic media, playing a major role in the reionization epoch. A metallicity dependence of the production rate or luminosity of the sources is a key ingredient generally assumed but not yet probed. Aims: Our goal is to explore the relation between the X-ray luminosity (Lx) and star formation rate of galaxies as a possible tracer of a metallicity dependence of the production rates and/or X-ray luminosities of HMXBs. Methods: We developed a model to estimate the Lx of star forming galaxies based on stellar evolution models which include metallicity dependences. We applied our X-ray binary models to galaxies selected from hydrodynamical cosmological simulations which include chemical evolution of the stellar populations in a self-consistent way. Results: Our models successfully reproduce the dispersion in the observed relations as an outcome of the combined effects of the mixture of stellar populations with heterogeneous chemical abundances and the metallicity dependence of the X-ray sources. We find that the evolution of the Lx as a function of SFR of galaxies could store information on possible metallicity dependences of the HMXB sources. A non-metallicity dependent model predicts a non-evolving relation while any metallicity dependence should affect the slope and the dispersion as a function of redshift. Our results suggest the characteristics of the Lx evolution can be linked to the nature of the metallicity dependence of the production rate or the Lx of the stellar sources. By confronting our models with current available observations of strong star-forming galaxies, we find that only chemistry-dependent models reproduce the observed trend for z < 4.