The supposed “illegality” of passing on the right is in reference to using the shoulder. If you’re on a two-lane road (one lane in each direction), then yes, passing on the right is illegal for non-emergency vehicles. When there are multiple forward lanes, a driver may use any valid forward travel lane to pass.