Fifty years ago, Ole Kirk Christiansen was an ambitious young carpenter in this speck of a town on the Danish moors. He started to make wooden toys, ducks, red roadsters, little baby carriages and decided to call his small company Lego, a contraction of the Danish words leg godt--"play well."

Today, Christiansen's son and grandson preside over Lego, now a group of family-owned companies employing thousands for the manufacture of one of the world's most popular toys--brightly colored plastic bricks suitable for building whatever a child fancies. In millions of households, in more than a hundred countries, Lego is a staple item.

Since the late 1940s, the Christiansens have concentrated on expanding the uses and designs of their standard bricks, resisting the temptation to diversify. They have been guided by a set of simple principles emphasizing the creative potential of play that makes Lego as popular with parents as it is with their offspring.

Foresight and luck have helped in the company's success, too. Although refusing to make guns and other war toys, Lego began to market a variety of kits on space-age themes at just the moment a few years ago when movies such as Star Wars and Star Trek captivated the 12-and-under set. In all, there are about 250 boxes to choose from, assuring that children can receive a different Lego present at every birthday and Christmas from infancy to adolescence, and still leave plenty of choices for visiting aunts and uncles.

The building potential is inexhaustible. A team of grown-up Lego employes, in what would surely be regarded as paradise by any small fry, spend all their time constructing elaborate models for shows, displays and an amusement park adjoining the headquarters here, called Legoland. They have done a scaled-down version of Mount Rushmore that required about a million and a half pieces, a U.S. Capitol with more than 300,000, and replicas of a host of famous buildings and statues, including "The Thinker" by Rodin.

(The professionals use glue to hold together their handiwork, something that Lego aficianados, strictly speaking, would regard as cheating.)

Lego has withstood the competition of numerous imitators--including a Taiwanese brand called Rego--because of the consistently high quality of their product, company officials say. The key is "clutch power," which is the grip that holds one piece to another. Measurements have to be exact down to minute fractions of an inch, which requires high-precision machinery and closely monitored quality control.

Lego's biggest problems at the moment are the effects of the worldwide recession on retail sales and the challenge posed by electronic and computer games to its appeal at the upper end of the targeted age bracket. Last month, the company laid off 250 of the 1,900 people in its Billund workforce and made proportional reductions in smaller factories in Switzerland and Enfield, Conn., adding up to the largest cutback in its history.

John Sullivan, the president of Lego's American subsidiary, said in an interview here that shipments were up in 1982 but not as much as the company had expected. Overall, the toy industry was hurt by the economic downturn, and Lego fared reasonably well compared to other companies, Sullivan said.

But, particularly in the United States, video games are a major new long-term factor in an industry already crowded with products. In only a few years, electronic toys have garnered 32 percent of the market, and their attraction is increasing as prices go down, he said.

Sullivan and other Lego officials believe that the company can withstand the changing tastes because there is something extremely satisfying to children in being able to put together and take apart complex structures, often of their own design. They say that the old-fashioned metal Erector sets, for instance, with nuts and bolts, were much harder for little fingers to master than the bricks, which snap together. For older children, Lego is adding an assortment of advanced models, with wheels, bearings and similar pieces that planners hope will make them sufficiently challenging..

Lego is an unusual international company because it is so closely held by the founding family and because it operates from this remote corner of Scandinavia. It was once written of Billund that it was a "god-forsaken railway stopping point where nothing could thrive." The railway is gone, the surrounding flatlands still offer an uninviting vista, but Billund appears to be flourishing as the home of one of Denmark's leading companies and largest exporters. Although no sales figures are published, one informal estimate puts total turnover at about $250 million annually.

The local airport is among the country's busiest, although the population remains only a few thousand. Many of the travelers are among the 900,000 people who each year visit Legoland, the amusement park where almost everything is built of Lego pieces. It has become Denmark's second most popular tourist attraction after Tivoli, the famous gardens in Copenhagen, according to company officials.

Lego is negotiating for a niche at the new Disneyworld Epcot Center in Florida, where it would feature more of the amazing giant-size Lego creations, Sullivan said.

For the first years of its existence, Lego consisted of no more than a dozen employes and never attempted to export any of its toys. It was Gotfried Kirk Christiansen, son of the founder, who began to devise what he called a "system" for the plastic pieces that they had begun to make a few years earlier.

The first foreign markets were in northern Europe, and West Germany is today the largest outlet for Lego, even slightly bigger than the U.S. market.