Here is a simulation. You will get different results, depending on the inductance and resistance of the coil, and the shunt capacitance.
In this example, the positive peak will break down the collector-base junction, and the negative pulse will break down the base-emitter junction.
I'm not saying the right combinations of parts won't work, just that you have to be aware of the dangers.
Anticipating a question: You will get the same results if the cap is tied to ground instead of Vcc.
I can't imagine why anyone would use a capacitor, when a diode is a much better solution.