Nitric acid is not used in pyrotechnic compositions but it can be used to prepare a variety of usefull nitrates from carbonates, hydroxides, oxides or free elements. It is used in the explosives industry in the preparation of a lot of commonly used explosives (eg TNT, RDX, PETN, nitrocellulose). Most high explosives have no use in fireworks, though nitrocellulose is used in some fireworks compositions as an acetone soluble binder.
It is possible to prepare nitric acid in several ways. It can also be bought at some drug stores. It is sold at professional gardening suppliers and at welding shops (it is used to passivate stainless steel after welding).
Nitric acid is corrosive. The fumes are dangerous to the lungs, eyes and skin. Skin will be stained yellow upon contact. Avoid all contact with both liquid and fumes. Wear eye and skin protection (lab apron, gloves, safety glasses, etc). In some reactions (especially those with metals) a brown gas will develop: nitrogen dioxide. It is very toxic, corrosive and will attack your lungs badly. Only work with nitric acid with adequate ventilation and proper protective clothing. Don't use any solutions more concentrated than 60%. Don't try to prepare high explosives at home and don't allow any organic material to contact nitric acid accidentially because that may result in the formation of dangerously explosive and/or sensitive materials.