No; TO should just disable allegiance change of the region.
If the Duke changes allegiance of his Duchy, the region should either auto-default to another duchy within its previous realm, or auto-surrender.
If it's a single-region Duchy, that's when it should prevent the Duke from changing. Possibly also when there isn't another Duchy within the realm for the region to go to.