Some cars have a plastic sleeve on the part of the door’s latch that meets the striker post (the peg on the car’s door frame that the latch engages). If the sleeve is badly worn or has fallen off, that could cause this type of problem. Carefully compare the affected door’s latch to the other doors to see if this is the case. If so, replace the missing/worn sleeve.
In some cases, adjustment of the striker post is all that is needed. Most of the time, however, the striker post itself hasn’t migrated, and adjustment just compensates for wear or misalignment in something else. But if the problem is minor, the adjustment is sufficient to address the problem.
Sometimes you can get an idea of the nature of the problem by closing the door with the outside handle/button/whatever pulled/pushed/whatever as if you were opening the door. Don’t lift or pull on the door, just let it approach the door frame naturally. Look for any sign that it is misaligned in the up/down and fore/aft dimensions. If it doesn’t nestle nicely into the door frame, you might have something sprung as mentioned above. In that case, a visit to the dealer or a body shop would be called for.