If South Africa loses to Ireland in the Rugby World Cup, it will depend on the score and bonus points earned by both teams, as well as the outcome of the Scotland vs Ireland match. If Scotland wins with a bonus point and Ireland gets a losing bonus point, all three teams will be tied on 15 points at the conclusion of the matches. In this case, World Rugby rules set out what happens in this situation. A list of criteria determines which teams qualify when teams are tied on points. The first of these is whoever won the head-to-head match between the two sides but where three teams finish level on points and have beaten each other, as is the potential case in Pool B, points difference will be the first deciding factor. The second-placed team will then be decided by who won the head-to-head between the two remaining sides.
If Scotland gets five points by winning and scoring four tries, while Ireland secures one losing bonus point, they would need to win by a margin of five or more points to progress. In this case, Scotland and South Africa would finish on exactly the same points difference, so it would go down to try difference. Ireland would qualify if Scotlands try difference improved by three or more as a result of their win. In this case, South Africa would get eliminated.
In summary, if South Africa loses to Ireland, they could still qualify for the quarter-finals depending on the outcome of the Scotland vs Ireland match and the bonus points earned by both teams.