You can, but Time Machine will consider the newly renamed Mac a different one than the one whose backups you used to populate its content.
If you were retaining the old Mac intending to keep it in service, yes I would give the new one a separate name, but that will result in the creation of a completely new set of backups on that backup drive. Not a problem, but Time Machine will retain the older one's backups forever, meaning it will not be able to delete its old "expired" backups.
That will effectively reduce the backup drive's remaining capacity.
Since you are surrendering the old one, I'd keep the same name. That way, Time Machine will pick up where it left off. Of course you could always completely erase the Time Machine backup drive, but if it is your only backup, don't do that. You never want to be without any backups, not even for a short time.
- Note: If you were to keep both Macs, Time Machine does not have a problem reconciling identical names. It assigns unique internal identifiers to each Mac and will keep their backups separate from one another. Identical names would just result in your own confusion.