Aslong as it fits and every thing works.
Some may argue thats its not a true representation of how many kms the vehicle has done, and you changed it to lower the odometer and so on....
but if your changing the engine then its up to you if you wanna know how many kms the engine has done or the vehicle.
No law against it.