Can you heal at the moment you get KO'd?
For reference: the rulebook.

There are 2 key phrases:


  May pay 2 Glory at any time to Heal a Wound (except during a Fight Round).


So lets assess 2 possibilities - Fighting and Everything Else.

Fighting:

If you are KO'd in a fight then it is clearly a no as this ability doesn't work during a fight round. 

NOTE: 


  Sometimes a card will say that it
  cannot be used ‘during a Fight Round’. Cards like this may
  however, still be used between Fight Rounds.


If you survive with at least one wound you can use this in between Fight Rounds as the round ends before another begins.

Everything Else: 

Since the ability may be used at any time then you can use it while taking damage to prevent KO*. In your example an event occurred, not a fight so this ability can be used.

*Nothing it the rulebook explicitly says a KO prevents this ability so I would interpret it this way.