It would be best to replace the whole section of framing, but, it is possible to replace just the section that's damaged.
When you say, "... where the lock is." Do you mean where the door knob's (or dead bolt's) strike plate is?
Can you post pictures of the damage or describe it in more detail? Not all door jams are created equal to one another, nor is all damage. It may be possible to simply repair it with wood putty and/or wood glue.