Indeed, there are other countries with ritualized pledges to flag and country: Pledge of Allegiance to the Phillipine Flag Pledge of Allegiance to the
(South) Korean Flag
Some other countries also have ritualized pledges expressing love of country and ideals, without specific reference to flags or symbolism: Rukun Negara, the Pledge to Malaysia National Pledge of India Singapore National Pledge Student Oath in Turkey
politics.stackexchange.com/users/10221/bishop
I think many other countries have an equivalent, but only for people acquiring that nationality by choice.
In my country, for example, we have an Oath of Fidelity to the Nation, used at the ceremony for new citizens and compatriots: I (name) having applied to the Minister for Justice and Equality for a certificate of naturalisation, hereby solemnly declare my fidelity to the Irish nation and my loyalty to the State.
I undertake to faithfully observe the laws of the State and to respect its democratic values.
Source
I think people born in a country would have no need to pledge or re-pledge allegiance to what is already their native country.
I'm not sure why you would want to do this unless there is some doubt about people's allegiances, which is clearly important in places with conflicting social or political backgrounds.
politics.stackexchange.com/users/29138/Peter Flynn
Answering for Kenya, we do have a loyalty pledge , though it is extremely rare to hear it being recited even in national holidays like independence day.
We used to recite it while in primary school just after singing the national anthem.
However, it has come to fade and does not receive much attention.
In fact, if you were to ask an 18 year old to recite it they would probably be like '
we have such a thing?' .
This is because it was used during the reign of the second president (Daniel Arap Moi, 1978-2002) as a means to instill patriotism especially in kids.
It was a time when the political environment was quite stiff.
This blog indicates a shared opinion of what it was really about.
It was mandatory to recite it then, unlike now, where only the national anthem is sung.
So to answer your question, yes for Kenya, but more of a historical thing.
EDIT
Since the link to the blog was pulled down, the summarized opinion is that reciting the pledge always felt more of influenced by the law and the stiff government of the time, than one's patriotic conviction.
politics.stackexchange.com/users/29145/Vinyl 
In the United Kingdom , persons who become naturalised citizens swear allegiance to the monarch and their lawful heirs and successors.
Non-religious people may affirm instead of swearing an oath.
Judges, military personnel, public notaries, and clergy of the Church of England, do likewise on taking office or being admitted to their respective status.
Holders of various important offices take the oath as soon as possible after assuming office, and members of either house of Parliament and the Scottish Parliament and Welsh Assembly must do so before they can take their seats.
Some people, including police officers in England and Wales, and members of the Privy Council who have a more elaborate oath, swear only to the current monarch.
Presumably they are re-sworn when there is a new monarch.
Native-born citizens who don't become any of the kinds of public servant listed above normally go through their entire lives without taking any oath of allegiance, as I have.
The idea of schoolchildren taking it at frequent intervals is one of the things that seem very strange about the USA to the British.
politics.stackexchange.com/users/11788/John Dallman
For Jamaica, we do have a national pledge said almost always said before or
after the national anthem you stand at attention (it used to be right hand over left breast) and say: Before God and all mankind, I pledge the love and loyalty of my heart, the wisdom and courage of my mind, the strength and vigour of my body in the service of my fellow citizens; I promise to stand up for Justice, Brotherhood and Peace, to work diligently and creatively, to think generously and honestly, so that Jamaica may, under God, increase in beauty, fellowship and prosperity, and play her part in advancing the welfare of the whole human race.
It's normally said in schools along with the national anthem and at many major occasions.
It's important.
It doesn't matter whether you're an immigrant or born Jamaican.
Everyone has to say it or at least stand at attention just like the anthem.
politics.stackexchange.com/users/33175/Ilovecandy 643
As far as I understand it, the pledge of allegiance is an oath or expression of allegiance to the United States, and is made by students in many (most?) schools throughout the USA, as well as at the start of Congressional sessions.  Do any other countries have such an exercise? If not a pledge to their flag and republic, to something else, like a monarch or their parliament?
Do any other countries aside from the US have a pledge of allegiance?
politics.stackexchange.com
<united-states>
politics.stackexchange.com/questions/48138
politics.stackexchange.com/users/28994/CDJB
Some other countries also have ritualized pledges expressing love of country and ideals, without specific reference to flags or symbolism:   Rukun Negara, the Pledge to Malaysia,  National Pledge of India,  Singapore National Pledge, or the  Student Oath in Turkey. Many other countries have an equivalent, but only for people acquiring that nationality by choice.  In the  United Kingdom , persons who become naturalised citizens swear allegiance to the monarch and their lawful heirs and successors. Other countries such as Malaysia, Turkey and Kenya do have ritualised and/or loyalty pledges. Furthermore, in the United Kingdom, allegiance is sworn to the monarch by those who become natural citizens. 
Other countries such as Malaysia, Turkey and Kenya do have ritualised and/or loyalty pledges. In the United Kingdom, allegiance is sworn to the monarch by those who become natural citizens. 