For the analogy work, the country should not know why is their spy there because MC does not know. Also, MC is more like a neutral country, even if they are under same sphere of influence. There is no way, neither a neutral nor ally country would accept an operator works in their country without their knowledge. If they get discovered, they will be arrested. Whatever happens next is entirely politics and power play, that operator can be bargaining chip, if they are from much stronger country would be silently extradite etc. but there is no way, they got scot free such a situation. On top of that, add the explosions, guns, dead bodies etc. She is fucked regardless of she is in hostile country or an ally.