Well, perhaps it is popular support that confers legitimacy -- on pretty much anything.
Our present constitution was codified at a time when the majority of Canadians did, in fact, wish to keep the crown as our legitimate head of state.
I find that hard to believe.
In 1867, Canada was mostly French-speaking, mostly Catholic. Not exactly the British monarchy's main base of support.
In any case, I'm not sure anyone bothered to ask Canadians at that point. It was a given that Canada would be under the British crown. This was still several decades before the Statue of Westminster; our laws were still subject to the approval of the British Parliament.
Yes, constitutions can be amended, again usually at the popular demand of the people. And I've no doubt that if enough Canadians decide that they wish to become a kind of republic with our own, home-grown head of state, then we have the ability to amend our own constitution to make it so.
The demand doesn't seem to have reached that level yet.
IANAL and all that, but it has occurred to me that there may be a workaround that doesn't involve a constitutional amendment.
Back in 2013 when Harper's government passed
legislation changing the order of succession to the Canadian throne, the Supreme Court upheld the government's argument that "changes to the laws of succession do not constitute a change to the 'office of The Queen' under the Constitution Act."
Harper's proposed (and luckily defeated) restrictions on non-resident citizens voting could be adapted to be criteria for Canada's head of state... and for generally the same reasons Harper gave for wanting to prevent non-residents from voting. The rules of succession - which, remember, don't need a constitutional amendment - could be adapted to add a requirement: anyone who has not lived in Canada within the past 5 years is ineligible for the Canadian monarchy.
If nobody in line from Queen Elizabeth meets this requirement, then the office of monarch could simply sit vacant until such a person comes forward... and in the meantime, any powers of the monarch would be vested in the Governor-General.
I'm not sure if this will ever happen, though.