President Reagan, in a speech opening the world's fair here today, used its theme, "Energy Turns the World," to claim credit for steering national energy policy in new directions that ensure the country "never again will be so vulnerable" to an oil embargo.

At the same time Reagan staunchly defended his faltering economic recovery program and renewed his hard-line attack on Democrats for pushing "tired old policies" of increasing government spending and raising taxes.

Bidding for public support at a time when confidence in his handling of the economy is eroding with rising unemployment and continued high interest rates, Reagan acknowledged that his administration had not turned the economy around. But he said there were hopeful signs in the slight increases in personal savings rates and housing starts.

"While our program did not, in its first 30 weeks, solve all of the problems that have built up for more than 30 years," he said, "it is beginning to work."

In his attack on the Democrats, however, Reagan did not mention a conciliatory gesture: his offer to raise taxes by $122 billion over the next three years and his expression of a willingness to defer the third year of his tax cuts.

Speaking for Democrats, Rep. Geraldine A. Ferraro (N.Y.) disputed Reagan's claim that his program is beginning to work. "The notion that the economic program is working simply does not jibe with the real numbers."

She suggested that Americans write Reagan to protest cuts in social programs. "I ask you to write the president with just one message: Be fair, Mr. President, be fair," she said. Ferraro's remarks were broadcast on radio as an equal-time response to Reagan's weekly five-minute radio talk, which was broadcast from the fair here today.

The thousands of people who turned out for opening day of the six-month fair in this Great Smoky Mountains foothills town gave the president and wife, Nancy, a warm reception, although their motorcade was met by about 50 protesters carrying signs that read "Feed the Hungry, Starve the Pentagon," "Ban the Bomb" and "Don't Cut Financial Aid" at the fair's entrance.

The Reagans traveled under unusually heavy security, giving them scant opportunity to see much of the fair, which features pavilions from 21 countries.

In addition to emphasis on new energy technology, the fair includes exhibits of bricks from the Great Wall of China and another introducing milk preserved so it does not spoil without refrigeration.

The idea for the Knoxville fair sprang to life during the Carter administration and the airy, U.S. pavilion here reflects Carter's concern for energy conservation.

Reagan administration officials, however, have been miffed at news reports billing it "Jimmy Carter's Fair," and contend that, while Carter may have initiated the idea, they carried it out.

Executive Protective Service Officers required fair-goers to enter through metal detectors. When Reagan spoke he and others on the platform were protected by bulletproof glass. A security helicopter hovered overhead.

Reagan said the technology at the fair probably "once seemed as fanciful as the extraction of sunbeams from cucumbers and 'Gullver's Travels.' "

But most of his remarks were devoted to discussion of how he had turned away from Carter administration energy policies, which he said brought only "gas lines, bottlenecks and bureaucracy." He has placed greater reliance on the free market and in building up oil stockpiles, he said.

"Instead of managing scarcity," he said, "we'll help ensure continued supplies from a strategic stockpile, alleviating shortages while permitting the private market to work.

"We will ensure that our people and our economy are never again held hostage by the whim of any country or cartel."

In his remarks at the fair's opening and earlier in his regular Saturday radio address, Reagan also took credit for the increased oil exploration and the decline in gasoline prices that followed decontrol of oil.

He did not mention that Carter began decontrol and that his administration had accelerated the final stage of it.

Reagan attended briefly a fund-raiser for Rep. Robin L. Beard (R-Tenn.), who is running for the Senate. After leaving the fair the Reagans went to the home nearby of Senate Majority Leader Howard H. Baker Jr. (R-Tenn.), where they are to stay before returning to Washington Sunday afternoon.

This evening's dinner at the Bakers was to be barbecued ribs and chicken, cole slaw, baked beans, potatoes and homemade ice cream. Guests were to include entertainers Chet Atkins and Dinah Shore and Tennessee Gov. and Mrs. Lamar Alexander.