Your hollow door may have been hung the wrong way around. The "lock side" has a timber block fixed in it to take the screws.
If so, try Tony's idea. I've done that many times, often gluing the plugs in with rapid wood glue.
In extreme cases, you can excavate the door and let a small timber block in. It's a bit of a game, and can only be done if the door is painted, because of the filling that's needed.
With the solid door... if it's not binding, as Heathfield has suggested, then the door could simply be warped. It happens all the time.
Very complicated to cure a warp, but it can be hidden. Take off the back-stop (thin strip of wood next to the hinges - the bit that the door closes to). Then, unscrew the hinge from the frame only, and extend the cutout inwards. Re-position the hinge as far in as you need, to bring the door into line on the lock side.