Fireworks have been used since ancient times. The Chinese were the ones that discovered powder, and although they did not use it for gun fire weapons, they found several other uses for it.
The first one is the one we still give to fireworks today, to make a display of light and fire at night that will impress and amaze viewers. Ever since the Chinese invented them, every single culture that has come in contact with fireworks has acquired them and used them for their own firework displays, in order to commemorate important events; for example religious rituals, civic commemorations, or just spectacles with no other object than to amuse the audience.
The Chinese also had another use for fireworks, a military one. There were, of course, no fireguns or fire weapons in that era, but they used them to bombard and surprise the enemy, even as early as in the times of the famous Han Dynasty. In fact, the book Romance of the Three Kingdoms, which is an epic tale of the wars that took place at the end of that era, tell us how companies of soldiers would gag their horses and hide behind a hill or a forest at night, waiting for the enemy to pass by, and then releasing a display of fireworks and drum rhythms as the soldiers sprang into action and attacked the ambushed enemy. We can only imagine how it would be to have such a display of force in a time where light was not available at night.
Other cultures have also given different uses for fireworks. For example, in Mexico, there is a metallic structure called El Torito, which is Spanish for The Little Bull. This structure has several fireworks connected together, so that when the first one is lit, it lights the next ones in succession. This torito is then carried by a man trying to show his bravery to his community. He then dances a ritual dance, carrying the structure on his back while the fireworks burn one after another.
Although I am sure the structures are made so that the fireworks do not burn the person carrying the torito, they still look dangerously close to the clothes. And of course, any accident, like tripping or grabbing the structure in the wrong way can result in serious burns or worse.
Lastly, fireworks can be dangerous if not handled well, and they have produced deaths in warehouses or markets where they are sold. This has resulted in some countries enabling laws that regulate their sale, control and storage.