I do not think anyone can argue with the sentiment of bearing true allegiance to Canada as an entity, but I am not sure, from a grammatical, a legalistic or a constitutional standpoint, how one can swear allegiance to a country as opposed to an institution, laws, a ruler or whatever.
Je doute qu'on puisse mettre en doute le sentiment d'une véritable allégeance envers le Canada comme entité, mais je me demande si, du point de vue grammatical, juridique ou constitutionnel, on peut prêter allégeance à un pays par opposition à une institution, à des lois ou à un dirigeant, entre autres.