A ball can pitch outside off stump and be given out.it’s the point of impact with the pad or body which is important. If the point of impact is outside off stump, then it’s not out, unless the batsman isn’t playing a shot, whereas if in the umpires mind it’s hitting the stump then it should be given out. If the ball pitches outside off stump but the point of impact is in front of the stumps then the umpire has a decision to make.
If the ball pitches outside leg stump the point of impact doesn’t matter. Pitching outside leg stump should always be not out.