I need to delete delivery orders that are in done state. But I can't do anything with it, there are no options to cancel it. What would be the best approach to safely cancel it and delete it?
Install Cancelling Entries Module.
Accounting -> Configuration -> Journal -> Stock Journal -> Allow cancelling Entries
Now you can cancel, set to draft, and delete the DO
In Odoo 11 onwards, When Delivery or shipment is in the done state, There is Unlock button.
When you click on this, Order become unlock and you will get an option to edit a Done Qty in Move lines.
If you want to just cancel the order, you can simply provide done qty as 0 and again lock it.
Effect of this is, you onhand qty for a product will decrease for shipment or increase for delivery as stock move receive 0 qty. It is the most safest way as it takes care of all stock related and inventory related odoo flow.