I know that these cars have issues with the timing chain tensioner and in some countries there was a BMW recall on the N47 engines specifically for this. A recall is where a manufacturer admits there was a problem and rectifies it free of charge.
The very first thing I'd do is establish if the cam timing is still in sync with the bottom end. There are a few ways to do this dependent on what you're able to see. In the past I've pried back timing covers, I'd watched cam lobes through oil caps and I've run compression tests. Any of these things work but it all depends on what you can do with the car.
That said, am I right in thinking that this has only just happened? If so, speak to the dealership and see what they'll do. You may have rights dependent on how you paid the deposit under remote purchase rules. You certainly have recourse to have the vehicle returned under the sale of goods act. Speak to the Citizens Advice Bureau and call the local council (locally to the dealership) and have a chat with their Trading Standard Officer.
I'm assuming that the dealer is attempting to say it's nothing to do with them and refusing to look at the car?
If the issue relates to the timing chain, this link may provide more information.