Phones are often "locked" in some way to stop behaviour that is not intended for general use by one of the phone manufacturer, phone operating system manufacturer or phone network.
Often the actions that are blocked would make it almost impossible to support the device, or would jeopardise the company's business in some manner.
For example, in many regions, handsets are subsidised by the network to which you're connecting, and to encourage you to stay with them, they SIM lock your phone to only work with their network.
Another example is that on Windows Phone OS (and iOS as well), it is not possible to install applications without using the relevant store. To enable developers to properly test their applications prior to public release via the store, this restriction needs to be removed, and essentially is what developer unlocking does (amongst other things). You can probably understand that it would also be difficult to support everyone in the world if they could download and install anything, as well as the security implications of virii. "Jailbreaking" is often meant as a synonym for developer unlocking.
"Unlocking" as a more general term can refer to either the removal of a SIM-lock, or developer unlocking.
Installing a custom ROM is one of the other things you can do with a developer unlocked phone, and it allows installation of an update to the operating system that is not available via the normal channels to the general public.
To developer unlock a device, the process involves setting up a developer account with Microsoft (at a cost of approx 99 USD, depending on your locale), and using the development tools from Microsoft.