Additional component to linear regulator
The diode protects the BJT in case of a sudden decrease in input voltage.
If we assume there is a capacitor on the output Vo (as there almost always is) then suddenly decreasing the input voltage to 0V would result in the discharge of that capacitor through the E-B junction reverse breakdown. That can damage or destroy the transistor. Many transistors suitable for this application would have a breakdown rating of 5V and actual breakdown in the 7-9V range, so 12V is more than enough. It would not be useful or necessary if the output voltage was 5V.
It might be better to simply put a reverse-biased 1A diode across the E-B junction because the diode as shown degrades the regulation and does not  protect against a possible bypass capacitor across the 12V zener.