Is Apple ID still considered as linked with my MacBook if I totally reinstall my Mackbook but use another Apple ID? For example, suppose I don't unlink my Mackbook in Apple ID, but I totally reinstall my MacBook and start using with another Apple ID. My question is, is my Apple ID considered as linked with that MacBook? Or in other words, does Apple ID link to the hardware serial Id?
As far as the Mac is concerned, yes. So that purchased software, iCloud syncing, etc. will no longer be associated (or available to) you on that Mac under that old AppleID.

But you will still need to log into that particular iCloud account and go to settings and then My Devices and remove that device there as well.