No, mercenaries are illegal. A mercenary is any person that has been professionally trained and recruited locally or aboard to fight in an armed conflict, for personal interest and not political interest.
On 4 December 1989, the international convention has legally forbidden the recruitment, financing, use, and training of mercenaries. After the confirmation that they use, training, financing, and recruitment of mercenaries was an offense of grave concern to all states that anyone caught committing this offense will be extradited or prosecuted.
However, it was only 35 countries that ratified the convention, and it entered into force on October 20, 2001. But some countries did not ratify because of their large military group. Lastly, Mercenaries are also recognized as illegitimate combatants, who do not have any legal protection when compared to captured service personnel of a regular army.