Hi!
If you fail a medical examination in one country for example in France you can do in another JAR countries like UK but you have to write on an application form that your previous class 1 medical certificate was denied and you have to write why and where. If you pass the examination in another country it won't be a problem even if you do your flight training in the country where was previously denied. BUT remember, you have to write on an application form that it was denied.
Good luck dude,
wite_k