Your question: how should I react and what should I do if I get a positive response from B after I have accepted the offer from A?
Answer: How would you react if you were responsible for recruitment A and a candidate has in mind the sort of plan you are describing?
You might find that the situation is as much about your UK colleagues as about your own reaction. From experience, the priority for your 'reaction' is to be totally transparent and honest with A colleagues about your application from the very start of the recruitment process A.
Then you leave it for colleagues to be accommodating with your situation.
They may take a bet on your application if they are very interested in your profile, hoping that your application B is not successful. If they are not in a position to take a bet - for whatever reason - then your honesty will make their decision easier and they should thank you for it.
If A colleagues discover late in the recruitment process that your application was not genuine but only a safety application, 'just in case' application B does not work out, they might be left rather unimpressed with your approach to the entire recruitment process. This would contribute in yourself building a bad name in what is usually a close-knit and networked community where word-of-mouth goes round very quickly.
In short, honesty and transparency.