My experience with instrument cluster swapping pre-dates digital display odometers by Toyota and Lexus, but I am pretty sure that the display on digital odometers comes from a module in the odometer itself and not from the engine's electronic control module (ECM). If the odometer is the rolling dial type, that is definitely in the odometer and not in the ECM. You may be able to detach the old odometer and use it in the replacement cluster.
You can physically swap the instrument clusters but the odometer will display whatever mileage is in the replacement cluster. I believe dealers have a way to order odometers from the factory with the correct mileage displayed. Check with the laws in your state. Some states allow a sticker to be placed on the cluster that shows the correction, for example, "display
- 40,000 miles." When you sell the vehicle, you may also be able to note that the true mileage is unknown ("TMU") but that notation is likely to make the car almost worthless in the minds of most buyers.