Given the case that a user is presented a modal dialog that displays an installation process (or something similar).
If the process would normally take a few seconds but can potentially take longer, should I offer a "Cancel" button to give the user full control? 

I've seen installers that disable the Cancel button and others that can do a rollback after Cancel is clicked. But what if one does not have the option of a full rollback? Should I ...

* trap the user in the dialog until the process is completed or a timeout is reached
* offer the Cancel button anyways, with the drawback of possibly generating data garbage or an invalid installation
['https://ux.stackexchange.com/questions/79016', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/19337/']
I believe the correct action would be to explain to the user before going through with the irreversible action, that the action is irreversible.

`"Doing this is permanent / This action is un-doable / You can not roll back this change" -> OK /cancel` Or something like that depending on what kind of users you have and what jargon they do or don't know.

Don't trap a user on a load screen if avoidable. If the load time really is so high that you have to expect the user to want to cancel out of it; then we can now acknowledge that the load time is very high. So let's make the user prepared for this long, irreversible load time and at least give them the option to start it in their own time.

Presenting junk data would only be okay if CRUD'ing / manipulating data was normal/easy/expected/not a hassel. But it usually is considering we as UX designers should value every single click we cost on the user.
If possible, present the user with a "Finish Later" option on the dialog, instead of "Cancel". If the install takes longer than they want right now, or they have something important they need to do right now that the install process is interfering with, they can choose that option and then you let them continue the next time the install process is initiated.