Scenario: The King of England's only son (referred henceforth as Duke of Cornwall) marries into Country A's (Scotland, Brittany, France, pick something) royal family. Country A's heir apparent dies, and Duke of Cornwall becomes the heir apparent of Country A through marriage. However, the Duke of Cornwall does something to royally piss the King of England off, and the King of England appoints his brother (not the Duke of Cornwall's brother, his own brother) as the heir apparent.
However, legally the title of the Duke of Cornwall can only be passed directly to the eldest son of the Sovereign. While the King's brother is now the Prince of Wales, he is not the Duke of Cornwall. Meanwhile, the Duke of Cornwall retains his title, despite being removed from the line of succession. The ruler of Country A dies, and the Duke of Cornwall assumes Country A's throne.
Can Country A declare war on the Kingdom of England, based on the premise that the Duchy of Cornwall is now the property of Country A?