If it wasn't an illusion, then the moon would literally be changing size depending on when you looked at it, by definition.
On the other hand, a heat mirage is an illusion in the sense that, if you go over and look for a reflective object, say a pool of water, at the location of the mirage, you'll find there's nothing there.
The moon illusion, unlike a mirage, is an illusion in that first, stronger, sense, but it didn't have to be. The image of the moon can change size in reality (for example, when viewed through a lens) without affecting the size of the actual moon.