This is a very tricky question because it's not clear which royal family you're discussing. The last time the dynasty changed by foreign invasion was in the Glorious Revolution of 1688, and there was a very widespread effort among the elites in England, especially the Whig faction, to invite in the House of Orange and conspire against the Stuarts. Stuart loyalists, or Jacobites, were the main group that thought of the House of Orange and, later, the House of Hanover as foreign, but the Jacobites were deeply limited in their support due to the House of Stuart's association with A. Catholicism and B. Scottish nationalism and C. the French monarchy (the Bourbons were very close cousins to the Stuarts and Louis XIV would become the Stuarts' biggest sponsors), which meant that even the English Tories that might have had closet sympathy with them would find the sort of people that backed the Stuarts very difficult to work with. The House of Hanover, which inherited the throne after Queen Anne died childless, was not very popular at first: George I barely spoke English and had little interest in this distant island.
Both France and Spain continued to recognize James II's son "James III" as the rightful king of England, Scotland, and Ireland, and James "The Old Pretender" attempted an invasion of Scotland in 1715 to reclaim the throne, but was swiftly driven off. During the reign of George II, James's son Charles, or "Bonnie Prince Charlie" or "The Young Pretender," attempted his own somewhat more credible invasion in 1745 that attracted support from disaffected Scottish people and Catholics across the United Kingdom, but they were decisively smashed at the Battle of Culloden. After Culloden in 1745 the idea of a Jacobite Stuart restoration became utterly implausible and the House of Hanover was clearly not going anywhere. There were still sympathetic old Jacobites, and there are even a few today, but there hasn't been a serious prospect of a restoration of the Stuart monarchy since 1745 (and, more realistically, since 1689).