An irrevocable trust can in some circumstances be altered even though it is irrevocable. The grantor sets up the trust but typically cannot alter an irrevocable trust.
Another party to an irrevocable trust is a trustee whose job is to manage or administer the irrevocable trust. The trustee may be able to alter the irrevocable trust depending on the circumstances.
An irrevocable trust may also appoint a trust protector whose job is to potentially replace the trustee if the trustee is not adequately administering the trust.
These are several examples of different parties that could alter an irrevocable trust. A court in some circumstances may alter an irrevocable trust. There has been a trend in the last decade or so for trustees and beneficiaries to reach a written agreement by which the irrevocable trust can be amended.
There is also a body of law called the Uniform Trust Code which 35 of the 50 states in the US have adopted and that has liberalized altering an irrevocable trust.