Radar guided SAMs may be dodged by ECM, nomatter they are launched.
Either such SAMs are guided by ground based radar or an onboard radar, effective ECM may blind the guidance radar.
For IR SAMs, flares are the best defence, other defence options are reducing engine heat emmisions.
Now...