It certainly is possible, and very do-able.
The wiki page state that Each city has an “intrigue level” which reflects how much clandestine activity is going on there, and if a city has an intrigue level it can be captured. There are no restrictions on it being the "last city".
The reason your Coup D`etat failed is because of a question that I answered here. I state that no matter what you have, there is always a chance for the Covert Ops mission to fail. Thus, why the operation was unsuccessful for the first time. Now, when you failed that operation there is several possibilities to what could have happened after as a result:
You just got unlucky. This is always a possibility on any covert ops mission.
An Agent(s) with a high Agent Rank died after the first unsuccessful Coup D`etat mission, resulting in a decreased chance of you completing the Covert Ops mission. **
It is good to mention that not always after an unsuccessful covert ops mission will your Agents die. There are four possible outcomes:
Undetected: The defending player is not notified that anything has happened.
Detected: The defending player is notified that a covert operation took place, but not who perpetrated it.
Identified: The defending player is notified that a covert operation took place and who perpetrated it. The agent is returned to Headquarters (escapes).
Killed: The defending player is notified that a covert operation took place and who perpetrated it. The agent is killed.