Irregular galaxies get their odd shapes in many ways.
One way irregular galaxies are formed is when galaxies collide/come close to one another, and their gravitational forces interact. Some irregular galaxies were once spiral or elliptical galaxies but were deformed by these uneven external gravitational force.
Another source of irregular galaxies may be very young galaxies that have not yet reached a symmetrical state.
Hope that helps