if I purchase a laptop with a 128GB SSD and a 1TB HDD with Windows 10 pre installed. How can I safely swap the 128GB SSD with a larger SSD without loss of the OS
Yes you can copy the data from the 128GB SSD to the larger one and then increase the partition. There are a lot of programms that do exactly that. After the transfer you can start from the larger disk no problem. (look for a SSD Migration Software)
Then plug in the new SSD and make a fresh install of Win10 (if that is the OS). The system should be already registered as a valid copy of windows and it reactivates online. Microsoft identifies the mashine by mainboard+cpu so no problem there. You would have to reinstall all drivers of course and the programs that came with it. No idea if that is completely possible as maybe some of the progs are not free.
In the steps where you should write the serial number just klick the "do that later button".