Used code bought on internet to unlock Galaxy S3 from 3 UK to O2-UK. Will rooting the device harm it?
Rooting the phone won't change SIM-lock settings, they're saved in a separate part of the phone, please see these previous questions for more info on that: Where are the SIM Lock settings stored on an Android phone?  and Does Unlocking bootloader affect network lock?

You can find more explaining these different terminologies here: What is the difference between: Rooting, Jailbreak, ROM, Mod, etc.?