Under the Highway Code it is acceptable to pass a vehicle on the left (usually referred to as undertaking) if the vehicle is signalling to turn right and there is enough room to do so or where you are in a separate lane and the other vehicle is being held up by traffic ahead.
Any manoeuvre should be done with care. Where you were undertaking you may find you are being prosecuted on a charge of Driving Without Due Care and Attention (Careless Driving) or, if you were also weaving in and out of traffic or travelling at excessive speed, Dangerous Driving. If you were involved in an accident at the time there is no requirement for a Notice of Intended Prosecution to be served on you.
We often come across arguments that no compensation should be payable in undertaking situations. The reality is that any case will turn on its specific facts and the liability issues may well be the same as for filtering. However, the existence of any conviction for either careless or dangerous driving on your part, will go a long way to reducing any responsbility the other side may have to take, so it is always worthwhile obtaining legal advice.