<p>I am using the <a href="https://jqueryui.com/dialog/" rel="noreferrer"><code>jquery-ui-dialog</code></a> plugin</p>

<p>I am looking for way to refresh the page when in some circumstances when the dialog is closed.</p>

<p>Is there a way to capture a close event from the dialog?</p>

<p>I know I can run code when the close button is clicked but that doesn't cover the user closing with escape or the x in the top right corner.</p>

If I'm understanding the type of window you're talking about, wouldn't
$(window).unload()
(for the dialog window) give you the hook you need?
(And if I misunderstood, and you're talking about a dialog box made via CSS rather than a pop-up browser window, then
all
the ways of closing that window are elements you could register click handers for.)
Edit:
Ah, I see now you're talking about jquery-ui dialogs, which are made via CSS.  You can hook the
X
which closes the window by registering a click handler for the element with the class
ui-dialog-titlebar-close
.
More useful, perhaps, is you tell you how to figure that out quickly.  While displaying the dialog, just pop open FireBug and
Inspect
the elements that can close the window.  You'll instantly see how they are defined and that gives you what you need to register the click handlers.
So to directly answer your question, I believe the answer is really "no" -- there's isn't a close event you can hook, but "yes" -- you can hook all the ways to close the dialog box fairly easily and get what you want.