Iran is not stupid but then, they may be crazy.
If history is any indication, Iran will be making a big mistake. If by any chance, Iran should begin to succeed, I have no doubt that Israel would use nuclear weapons rather than be destroyed.
It is called the "Sampson Option" and you are right - they will.