Hi,
In the default ODOO the field 'Carrier'(carrier_id) of delivery order is read only in state done and cancel. When the delivery order is validated, it is in the done state, so the carrier cannot be changed. In order to change the field after validation you need to remove the readonly properties of the field carrier_id. By default, it is defined as:
<field name="carrier_id" attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}" options="{'no_create': True, 'no_open': True}"/>
Inherit that view and replace it as follows
<field name="carrier_id" options="{'no_create': True, 'no_open': True}"/>
Alternatively, you can update the value by writing a query or using postgres
For view inheritance please refer the blog
https://www.cybrosys.com/blog/different-types-of-inheritance-in-odoo-15
Regards