Assuming you are on a through ticket, it’s really not worth worrying about this. In the unlikely event that the UA flight is 2 hours late, there are many rebooking options from LHR (and this would likely be done for you mid flight). Generally T2 is operating pretty efficiently so I wouldn’t anticipate any problems there.
However, if on separate tickets, you could face major problems if UA is late. In that scenario you would need to contact Thai to change your flight from BOS while you are waiting for its delayed departure.