How To Hang And Frame A Door
Doorway openings in stud walls that are out of plumb can make door installation problematic.
As long as the base of the wall isn’t locked in by flooring, the solution is simply to nudge the base plates on both sides of the opening back to plumb.
You will need to cut the nails securing the base plates using a reciprocating saw or oscillating tool, then move the walls into position using a sledgehammer.
Check for plumb and if either side is more than about 7mm out of plumb, adjust the wall before you install the door.
TIP: Once the walls are plumb, reattach the base plates to the joists by skew-screwing in place.