Badges of various designs were certainly worn with the shako introduced in 1799. The grenadier "mitre cap" introduced in the British army in 1678 sometimes had a metal (usually brass) front plate, but often the entire cap was made of cloth, with the badge an integral part of the design.
https://line.17qq.com/articles/gphlnlnlv.htmlAs far as I know the tricorne worn by line companies prior to 1799 did not have a badge.
Countries tended to copy each others uniform trends, so one would need to research which country first introduced the grenadier cap and which country first introduced the shako.
According to the (British) Army Dress Regulations:
The office of Inspector of Regimental Colours was instituted in 1806 in order to regulate the
design of the various Colours, Guidons, and Standards of the Army. Regulations for these had
been laid down in 1768, but were widely ignored and designs left to the whim of individual
Colonels. The first Inspector was George Nayler (1764-1831), York Herald, later Garter King of
Arms.
Since that time the office of Inspector has normally been held by Garter King of Arms. The
present incumbent, Thomas Woodcock, was appointed in 2010. As the Army's heraldic adviser
he is responsible for approving all new designs for Colours, Guidons, Standards, Cap Badges,
Defence Agencies etc. The artwork for all new designs is prepared at the College of Arms by a
heraldic artist, signed by the Inspector, and then submitted to The Queen, via the Ministry of
Defence, for formal approval. Once The Queen has signed the painting, it is returned to the
College for safe keeping.