William Perkin is credited with with making the first synthetic organic dye (using chemists’ meaning of organic, ie. carbon-based molecules) when he accidentally discovered aniline purple, aka. mauveine, in 1856 while trying to make quinine. (Incidentally Perkin set up his factory to manufacture mauveine on the banks of the Grand Union Canal just half a mile from my home in Greenford.)
However Perkin was probably beaten to the first organic synthetic dye by the Egyptians, possibly as early as 3000BC. By heating a mixture of sand, ash, calcium carbonate (from shells?) and a copper ore to temperatures of over 800°C they manufactured blue calcium copper silicate, otherwise known as Egyptian Blue. This was then used in glazes to produce a stunning range of hues — as in this votive cup with cartouche of Amenhotep III (c.1391–1350BC).

There’s more on modern chemistry firsts which were known in ancient times including chromium plating, concrete and nanotubes.