Dolls were blown up and watermelons were exploded on the Mall yesterday.

The purpose of the display at the Washington Monument was to demonstrate the danger of illegal firecrackers, particularly to children, with the Fourth of July holiday approaching.

"We wanted to show what explosives can do to children," said Terrence Scanlon, chairman of the Consumer Product Safety Commission, which sponsored the demonstration that focused on the danger of do-it-yourself kits.

A CPSC engineer detonated firecrackers made from a mail order do-it-yourself kit. The firecrackers, more explosive than legally permitted, set the dolls on fire and scattered the watermelons several yards.

Federal standards limit the amount of explosive material in a firecracker to 50 milligrams. CPSC officials said that consumers are able to make larger fireworks from kits that contain explosive materials approximating a quarter to a half of a stick of dynamite. The kits, officials said, are widely available and they warned parents not to allow children to purchase them.

CPSC officials said they have brought legal action against three do-it-yourself fireworks mail order firms, which they declined to identify, and they said they are investigating others.

Another danger with homemade fireworks, officials said, is the problem of working with highly explosive chemicals. A spark or a cigarette can cause an explosion.

Seven people died and more than 9,800 people, many of them children, were injured in fireworks-related accidents in 1984, according to the CPSC. A majority of the accidents are caused by illegal fireworks, according to the agency, which estimates that 55 million pounds of fireworks are used each year, with just one-third used in large public fireworks displays.

Federal law permits the sale and possession of fireworks with sturdy construction that do not contain more than 50 milligrams of explosive material and that have wicks that detonate between three and six seconds. States, counties and municipalities frequently adopt more stringent laws.

CPSC officials said it's often difficult to tell whether fireworks for sale are legal devices, but they suggest that a buyer be sure that the warning label is a contrasting color to the rest of the firecracker, that the name and address of the manufacturer is written clearly on the package and that the firecracker does not seem to contain too much explosive material.