We discuss the implications of assuming different star formation histories (SFH) in the relation between star formation rate (SFR) and mass derived by the spectral energy distribution fitting (SED). Our analysis focuses on a sample of HII galaxies, dwarf starburst galaxies spectroscopically selected through their strong narrow emission lines in SDSS DR13 at z<0.4, cross-matched with photometric catalogs from GALEX, SDSS, UKIDSS and WISE. We modeled and fitted the SEDs with the code CIGALE adopting different descriptions of SFH. By adding information from different independent studies we find that HII galaxies are best described by episodic SFHs including an old (10 Gyr), an intermediate age (100-1000 Myr) and a recent population with ages < 10 Myr. HII galaxies agree with the SFR-M relation from local star-forming galaxies, and only lie above such relation when the current SFR is adopted as opposed to the average over the entire SFH. The SFR-M demonstrated not to be a good tool to provide additional information about the SFH of HII galaxies, as different SFH present a similar behavior with a spread of <0.1 dex.