It is not possible to tell whether the OK or the Cancel button was clicked beacuse, like you said, you do not "own" it.
With that being said, there is a trick that theoretically should work. If the user clicks cancel, then the onunload event will never be executed and everything stays as it was before the popup was executed. If the OK button is clicked, however, the onunload event will be executed. So, the theory is: you can figure out if the user clicked OK if the onunload event was executed. The problem with this is that there isn't much you can do in the onunload event because at that point, it is unstoppable.
So, for a definitive answer to your question: No. The typical onunload event that is fired after the onbeforeunload event will not be fired if the user clicks cancel.