Assuming you're using the stock kernel (with no dependency on particular hardware), and the CPU architecture is the same (x86, amd-64, etc), there's no reason why swapping the HDD would prevent Ubuntu from booting. Check /etc/modules
and /etc/modules.d
for any hardware-specific tweaks you may have done on laptop A which may cause issues when applied to laptop B.
I wouldn't bother removing any 3rd party drivers you had to install for laptop A hardware. Such drivers (e.g. AMD Catalyst) often don't cope well with package managers, so during the uninstall they can alter or remove files used by something else in your system. I have a first-hand experience when removing Catalyst from a Lenovo laptop resulted in a broken system.
Another kettle of fish you may want to check is Xorg configuration: if you had to tweak /etc/X11/xorg.conf
to get hardware acceleration or multi-screen desktop on laptop A, those setting may prevent the X server to start properly on laptop B, and though your system will still boot you won't get the desktop environment you're familiar with. If your plan is to permanently transfer the HDD to laptop B, I'd recommend to simply delete /etc/X11/xorg.conf
(making a backup beforehand) to let the X server do the autodetection.
I cannot foresee any issues that could arise from transferring the HDD from laptop A to laptop B.