Iran has survived this war so far because the aggressor hasn't made any attempt to actually defeat them. It's very different from Ukraine, which is holding its own against an all-out invasion. Iran might well be able to withstand an all-out invasion by the US, but it hasn't had to yet.
Right now, the US is half-heartedly trying to bomb Iran into submission, something that in the entire history of aerial warfare has worked exactly once (and even that one time is debatable).