It is only illegal if you conceal the fact. If you are changing a defective clock, the honest thing to do is to spin the new one up to the mileage of the clock you are replacing. Barring that, it should be recorded in the logbook somewhere. If you conceal the fact at the time of sale you are guilty of fraud.
"Clocking" is a huge problem and having spent a fair bit of time in the trade myself, I can say that it is rather widespread. Prime suspects are German cars whose interiors seem to wear like steel and really dont show their miles.
And I agree with BozVanDam that whatever the new mini is, it certainly isnt a mini!