Labor Secretary William E. Brock preached the gospel of labor-management cooperation to the AFL-CIO today, saying it is a crucial ingredient in the nation's ability to meet foreign competition.

Brock's speech, the first by a Reagan administration labor secretary to an AFL-CIO convention, followed three days of proceedings in which union leaders leveled withering attacks on Reagan's economic, tax and trade policies.

While Brock "commended" the AFL-CIO for its "tough, feisty, aggressive" stance in "standing up for what you believe," he departed sharply from his prepared text and omitted several effusive statements praising the labor union federation.

Later, Brock said, "I stand by the speech as written, everything in it," explaining that he omitted the pro-AFL-CIO statements because his original speech was too long.

"I kept some praise in it, and I made some comments about what was right with the country, for some balancing" of the AFL-CIO's criticisms of Reagan, he said.

Brock added to his original text several references to Reagan's policies having reduced the "cancer" of inflation and created record numbers of new jobs.

Brock told the nearly 1,000 union officials it is "stupid" for businesses to seek to compete by cutting wages instead of seeking more cooperative methods of reducing labor costs and improving productivity.

"Some say we should adopt strategies of ruthlessly cutting labor costs," Brock said. "We can see this policy being followed in a number of subtle and not-so-subtle ways like 'outsourcing,' relocating production facilities abroad and an increase in union-avoidance activities."

"Outsourcing" refers to shifting work from unionized plants to nonunion sites, often overseas.

"To me, it is stupid to try and improve our competitive position by reducing the standard of living now enjoyed by American workers and their families," he said.

Brock had devoted most of the first five pages of his written speech to praising the historical role of unions and lauding AFL-CIO efforts to boost membership by trying new union-organizing methods.

One of his omitted statements read: "I know of no institution in our society that has engaged in more open, public and honest introspection than the AFL-CIO . . . . I can think of no organization, public or private, which has shown greater courage or honesty in carrying out a comprehensive program of self-analysis, and doing it in the full glare of close public scrutiny."

Such comments, Brock's warmest praise of labor unions since taking office six months ago, are seen as part of an administration effort to mend fences with the AFL-CIO.

The federation never invited his predecessor, Raymond J. Donovan, to a biennial convention because of personal and political conflicts between him and AFL-CIO President Lane Kirkland and other officials.

Kirkland, in introducing Brock, praised him as a "straight-shooter" who has opened lines of communication between the administration and unions.

Brock praised the willingness of the AFL-CIO and employers to experiment with new cooperative programs, such as involving workers in workplace decision-making. He cited General Motors' new Saturn project as a model for such efforts.

He said the growth of "two-tier" pay systems, in which new workers receive lower wages, results in short-term savings for companies but said, "I'm not sure it's sustainable" because such pay schemes create conflicts among workers.

Brock also said it is "distressing" that more companies do not consider the benefits of flexible work hours and child care, which he said would enable working parents to be happier and more productive.

Earlier today, United Mine Workers President Richard L. Trumka became the first official of his union to address an AFL-CIO convention. Legendary UMW president John L. Lewis quit the labor federation in a bitter political dispute in 1947, eight years before the AFL and the CIO merged.