The Russians refuse to admit it for a whole variety of other reasons (all of them bad).
In case of Iran, it was a horrible mistake when they where expecting retaliation form the US. Not that this justifies anything, but it’s fairly straightforward.
MH17 was shot down by a BUK that was not supposed to be there, totally…