The fact that the drive is toshiba and the laptop is toshiba is irrelevant. It just so happens that toshiba makes hard drives and they make laptops, while Dell, HP, etc just buys drives from Seagate, WD, HGST, etc and puts them in the laptop.
You can put a Samsung SD card in any brand of phone, and samsung phones can take any brand SD card.
So you can put any 2.5" hard drive into any laptop that accepts 2.5" drives and the drive will work.
Now when talking about Operating System and Programs that is a completley different ordeal.
Windows is installed to a system and configured for certian hardware. You then install drivers for that hardware.
Swaping a drive in the exact same laptop model (with same hardware) will work just fine...