For example, you could say:
"I'm sorry you cannot delete this document"
A better message may be:
"You cannot delete this document when someone else is viewing it"
and even better may be:
"You cannot delete this document when someone else is viewing it. Click here to see who is viewing this document".
If you want to apologise when the user does something wrong, then build software that doesn't cause the user to generate an error situation in the first place. By apologising you are supporting the fact that it was okay for the user to do what they did or that they were treated unfairly, when it isn't, because the user still can't do it.
If the user wasn't to blame, then by all means apologise and reassure them that the issue will be addressed. Also clearly explain what the expectations are from now on, such as, loss of data.
That's my take on it, and I wont be apologising for that. But if you want to know whether you should apologise or not, you need to do some usability testing and see if it has any impact on the goals of the software and the user experience.