As the leftist candidate stands on the brink of becoming New York City’s next mayor, Iran’s history offers a stark warning.