I've seen some dialogs, at least these:
- Edit / File properties
- Edit / Floating point value
that have question "Do you want the above content to be copied to the clipboard?". And then Yes and No buttons at bottom.
So to just close the dialog, user has to answer that question. And the Yes-button is the default button so if user just presses Enter to close the dialog, it overwrites user's clipboard content.
Copying to clipboard is option, not the point of the dialog. So it must be an option in the dialog too.