The US did it all the time in Vietnam.
Not sure if it was actually used, but a fun idea for pilot recovery..
…against the viet cong, where the biggest risk was the pilot getting pierced from small arms fire (in addition to the helo going down from pilot error). Quite different from the anti-air weapons modern day Iran possesses.
And it did sometimes get way out of control: https://en.wikipedia.org/wiki/Rescue_of_Bat_21_Bravo