This is better asked on a technical support site.
In any case I’m assuming you mean there is physical damage to the DVI port on the machine.
Laptop or Desktop.?
Laptop: Most likely needs professional repair as its attached to the MB inside machine.
Desktop: If its on-board graphics then you’ll need a replacement MB.
If its your graphics card then you’ll need to replace that.
Unfortunately its not a simple matter of just replacing it as DVI ports are generally connected (quite firmly) to another piece of equipment inside your machine.