The optimism that is expected to mark President Reagan's State of the Union address tonight will echo the messages that prominent governors have given their states in recent days. But the governors dwelled more heavily on the threat of federal deficit-cutting measures than Reagan is likely to do.

A sampling of "state of the state" messages from a dozen governors, both Democrats and Republicans, shows a generally buoyant tone, reflecting improving economies and healthy fiscal situations. In a characteristic passage, Alabama Gov. George C. Wallace (D) told his legislature, "Alabama is healthy. Our economy is growing. Many of our people are now looking for a better job -- and not just a job."

The upbeat rhetoric is not universal. Iowa Gov. Terry E. Branstad (R) said in the opening paragraph of his message that his state faces "the worst agricultural crisis since the Great Depression. Land values have dropped 60 percent since 1981, with over $40 billion in wealth drained from Iowa."

But most of the governors in the survey began their present terms in January 1983, at the depth of the recession. Many of them were forced to raise taxes in their first year to finance essential state services. And many of them are riding the long, low-inflation period of economic growth to much more comfortable fiscal prospects.

Ohio Gov. Richard F. Celeste (D), for example, said that "Ohio had hit bottom -- its lowest point in 50 years," when he took office in Columbus, and since then, 541,000 people have found jobs in the state. Sounding like a cheerleader or television salesman, Celeste proclaimed: "Our Pride Is Back in Ohio." (The words were capitalized in the printed text of his message.)

That Reaganesque boosterism was particularly conspicuous in growth states from Arizona to New Jersey. Arizona Gov. Bruce Babbitt (D) declared, "The state of Arizona, I am proud to report, is vital and strong -- and, still, improving . . . . Our children are safer, our water more plentiful, and our highways more nearly complete than before we began our work. The rate of crime has dropped. The least advantaged among us have far better medical care. Arizona's growth and opportunity are the envy of the nation."

New Jersey Gov. Thomas H. Kean (R), fresh from a landslide reelection victory, said, "I am proud to report today that New Jersey is strong and healthy. The state of the state is good: 3.5 million New Jerseyans are at work today -- more than at any other time in our state's history. Our standard of living is higher than 47 other states. We have risen to fifth in the nation in tourism, fourth in foreign investment. Our leadership in high technology is earning us the title of 'Silicon Valley of the East.' "

Contrary to the end, Colorado Gov. Richard D. Lamm (D), retiring after 12 years, used his final message to highlight "missed opportunities" and "past mistakes" that he said left the state with a large "unfinished agenda" of social and physical needs.

But other Democrats in states not noted for being in the vanguard of change sounded far more optimistic. "Vermont is in excellent economic health," freshman Gov. Madeleine M. Kunin (D) told her legislature. "Our unemployment rate in October, 3.9 percent, was the lowest of any October in 10 years." Kunin also said that the deficit she inherited last year will be paid off by June and promised "the largest tax cut in the history" of her state.

Aside from the economy, the biggest bragging points for the governors were the gains in education, which they linked to reforms in school programs and improved financing in their states.

South Carolina Gov. Richard W. Riley (D), who put through one of the most comprehensive programs, said: "For the first time, the average scores of all our public school students are at or above the national average in basic skills tests -- producing the highest two-year gains by the children of any state, at any time. We have led this nation in our gains on the SAT. And our students have a new positive attitude toward learning reflected in our attendance levels -- the highest in the nation."

The darkest clouds on the horizon, several governors said, are the coming federal budget cuts.

Wallace warned that "the federal government plans to balance the budget on the backs of the poor people who depend on public assistance and social services . . . . This loss of money will devastate the delivery of social services in the state."

Lamm said that cutbacks in federal-aid programs constitute "buck-passing without the bucks . . . . To put it bluntly, the burden of the consequences of federal mismanagement are being placed on state and local governments."