Can I install a nest thermostat on a 2-wire boiler (with unmarked wires)?
If you have only two wires on a heating system, then those two wires are the ones known as R (red) and W (white), and it doesn't even matter which one is which because it's AC and there are only two. (If you had a more complex system with cooling or other features for the thermostat to control, then there would be more wires.)

To confirm, get a multimeter and measure the two wires on the AC voltage mode (you should see about 24 volts). If you hold the wires together the heat should start. If this doesn't work, the problem may be with the boiler rather than the thermostat.

You probably know this already, but just in case: your old thermostat has a significant amount of mercury in it. Make sure to take it to a household hazardous waste disposal station rather than putting it in the trash.