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.
Swapping a drive between two laptops with marginally different hardware may work ok once it loads new drivers, or it could be unstable
Swaping drives between two laptops with very different hardware (different generations of chips, intel vs amd, etc, and the system will be unstable or even just fail to boot.
Then there is the licensing issues. Taking a OEM (like dell. hp, etc) computer's drive and putting it into a home built desktop with no OS is a big no-no violation of licensing even if it would work. Swaping drives becuase you want a different version of windows is also a no-no. Swapping a drive with say Win 10 home for a drive with Win 10 home is not per say technically legit but microsoft is not going to have a fit about it.