The general principle of the 18th-19th century were :
- any state could raise foreign units in his pay, with a blend of foreign and national officers and men. A quarter of French army of Ancien Régime were strangers, German units in British pay were at least as numerous during ACW
- even in national units, foreign rank and files could be drafted : due to men shortage, Wellington completed his british units with Spanish soldiers (Oman).
- officers had to ask permission to their sovereign to accept service in foreign army. Sir Halkett, british subject, started his career in Dutch Guard before transferring to british army.
- officers had to get a commission from the state that will pay them, to get official sanction of their rank in the unit.
Ownership of regiments by foreign colonel still meant that he had a word about promotion, but under the sovereign sanction.
This make a difference with armies of the 16th-17th, when the whole units was raised by a colonel, who negotiated the state and the pay they will fight for.
KGL is a specific case.
KGL was a foreign corps, which did not have the right to stay in Great Britain, only on minor british islands or foreign station
As Hanoverian army in exile formed the nucleus of the KGL, many KGL officers were Hanoverians, subject to the Elector of Hanover who happened to be also King of England.
So they could transfer to British army without changing personal allegiance and could command british units, once the proper commission was granted.
Other foreign corps were not in the same case.
Portuguese units were part of Portuguese army, but accepted to have British officers, provided these officers in turn obeyed to Portuguese ones, with Portuguese marshal / English general Hill at the top of the pyramid (Oman, Weller).
French Emigrés, Swiss, Greek, Italian regiments, were foreign troops under british command, as were native regiments oversea. Their commanding officers were british, and their foreign officers could not get promotion outside their units. But still, a commission had to be issued by british army to give authority to the officers over their men.