That's a really difficult question. While it is technically possible to do it, it's quite complicated and error-prone. You would need to modify Moodle's database directly in a lot of places, which is quite risky unless you know the database structure very well.
There are two ways Moodle refers to a users:
- by their usernames (which is only used in very fewplaces, like the user list table, the logs table, and probably one or two other places),
- by their internal numeric IDs (which is used almost everywhere). This is where you should put all your efforts.
You would need to modify every single table that references the internal ID and change if from the soon-to-be-discarded-ID to the want-to-keep-user-ID. Of course this means you should already know which those tables are, which depending on your Moodle version and the contributed plugins you have installed can vary quite a bit.
As I said before, while technically possible, it's not trivial at all.
Oh, and by the way, don't even try to do anything like this before having full backups of your Moodle database and having restored them at least once (so you know you can recover when you screw up your database).