How Irregular Galaxies (Might) Form
While there's no regular way in which irregular galaxies may form, with regards to the two Hubble types, there is a general paradigm. Irregular galaxies don't start out being irregular, but rather form from more regular galaxies such as spirals or ellipticals that are then twisted and contorted into different shapes by the gravitational influence of collisions or near-collisions. Telescopes have been able to locate these collisions at all stages of development, with galaxies slowly being torn into chaotic forms before our eyes. These mechanics are not well understood, especially with regards to the existence of dark matter, so this is still very much a developing field in astronomy. Additionally, because every collision is different, each irregular galaxy must be considered on a case by case basis to consider how it formed.
Now, again, that only applies to those Hubble types. Dwarf irregular galaxies, on the other hand, may develop in a whole other fashion. These are theorized to be among some of the earliest galaxies to have formed, as well as one of the most common during that time period. While they consist of hot, massive young blue stars, because they are seen at such great distance they were originally termed faint blue galaxies (FBG). These galaxies may have later merged to form more organized galaxies, such as spiral or elliptical galaxies, though this is uncertain.
Not all dwarf irregular galaxies are so young, however. There are also dwarf irregular galaxies that exist nearer to us, that is, being considerably older but still strongly resemble the primeval low metallicity-high gas content of their younger cousins. Why dwarf irregular galaxies also exist here does not fit into the previous paradigm. Astronomers have also noted dwarf irregular galaxies forming from the distortion of small spiral galaxies, which adds even more questions to the pot. Only more scientific inquiry will tell!