ISIS claimed responsibility for the attack but Iran’s supreme leader and president sought to link it to the protests that have gripped the country.