Passing on the left when other road users expect to be passed on the right is also arguably driving without due care.
To prove driving without due care, the prosecution have to prove that the standard of driving fell below that of a careful and competent driver. Passing on the left, when motorists expect to be passed on the right as per the highway code, when the option to pass on the right is there, is clearly negligent. If you can pass on the right then do so - there's no excuse for passing on the left if you can pass on the right! Doing so might cause a collision because motorists expect to be passed on the right, not the left. The middle lane hogger might move into the left lane when you approach so that you can then pass in the middle lane. If you're going for an undertake that could cause a collision, and you'd both have some degree of liability for using the road in ways it was not intended.
The highway code isn't law. It's *not* illegal to undertake in the UK, providing you do it safely. Police will most likely pull you if you pull into the inside lane in order to do it, for the reason below.
What other motorists expect you to do makes no difference, since when pulling from the right to left lane you should check blind spots for cars anyway. If you're in the inside lane, with no traffic doing 70mph, whilst somebody is in the middle lane going 50mph, you can continue on the inside lane. That would be a safe undertake.
If, however, you were also in the middle lane, got right behind them, then indicated left to pull over, that would be dangerous, since you would reasonably expect that the driver may pull to the left to let you pass. That situation would be considered driving without due care and thus illegal. Same as weaving in and out of lanes would be considered dangerous.
Ultimately, there is no law against undertaking, and the act of undertaking itself, unless you specifically move over to do so (causing confusion) would not be sufficient evidence to hold a dangerous driving charge. I would like to see the law changed - to either make it legal to pass on either side, or to make it illegal to be undertaken unless you're turning right, since if there's room for you to be undertaken, you're not driving in the correct lane.