President Reagan sought a respite from a week of controversy as he flew to the Johnson Space Center today to praise the two astronauts orbiting in the space shuttle Columbia and later to attend a Republican fund raiser honoring his chief of staff, James A. Baker III.

The president also planned to hunt wild turkeys on Saturday as Baker's guest at a ranch about 200 miles southwest of Houston before returning to Washington on Sunday.

Reagan did not mention directly the controversy that erupted this week over remarks by his budget director, David A. Stockman, doubting that the administration's economic program would work. But he devoted most of his remarks to another defense of his economic proposals and reiterated that he is not prepared to change course in the face of mounting unemployment and budget deficits.

"One thing I'm against, we're not going to have a tax increase," he said.

Baker, though, did manage a joke about the Stockman controversy in his remarks.

Baker told his home-town audience that before he and deputy chief of staff Michael K. Deaver left the White House today, "We turned off the lights, we turned down the thermostat, and we bound and gagged David Stockman."

Reagan attended the fund raiser after a brief stopover at the Johnson Space Center, where he spoke for several minutes with astronauts Joe Henry Engle and Richard H. Truly.

"Joe, Richard, this is Ronald Reagan," the president said.

"I just wanted to make a request. I just wondered if when you go over Washington before your landing at Edwards Air Force Base, could you pick me up and take me out? I haven't been to California since last August."

"We'd be very proud to sir," came the reply from space.

Reagan told the crew how much he was enjoying his visit to mission control: "I told them when I came in, this is a rare experience for an old horse cavalry officer."

"Let me just say I'm sure you know how proud everyone down here is and . . . the whole nation. I'm sure the world, but certainly America has got its eyes and its heart on you," Reagan said. " . . . All of us here are watching with great pride."

Engle and Truly flew the space shuttle into orbit on Thursday after the mission had been delayed four times in the last two months. A fuel cell failure that developed shortly after the launch has forced the flight directors to cut short the mission.

The president's visit to the space center was decided upon at the last moment, deputy White House press secretary Larry Speakes said.

The Republican dinner, billed as a "salute to a stronger America," honored Baker and 10 other Texans who were appointed to the administration. Businessmen and politicians attending the event paid as much as $10,000 to fill a single table.

Organizers of the event included Texas Gov. Bill Clements, Sen. John G. Tower and former treasury secretary John B. Connally.

However, Tower did not attend the dinner, the biggest fund-raising event of the year for the Texas Republican Party, which expects to gross nearly $900,000 from it. Tom Hackaday, political director of the state party, said the dinner conflicted with Tower's duties as chairman of the Armed Services Committee. Hackaday and Speakes said the senator's absence did not indicate that he is unhappy with the administration.

Baker, a multimillionaire Houston lawyer and Princeton graduate, served as a top political adviser in two hard-fought campaigns against Reagan before he joined the administration this year.

In 1976, Baker was chief delegate hunter for President Ford during Ford's primary campaign against Reagan. Last year, Baker ran the unsuccessful primary presidential campaign of his friend and fellow Texan, Vice President Bush.

Baker, who has been an avid hunter since he was a youngster, invited Reagan to Saturday's wild-turkey hunt at a ranch near San Antonio owned by the family of Baker's wife, Susan.