Thousands of federal employes across the country will begin paying for parking at work today, in the name of goals -- energy conservation and cleaner air -- nearly obscured by their complaints that the idea is illegal, illogical and inequitable.

Though for the next two years federal workers will get a bargain rate, about half that charged by commercial lots, thousands have written or called members of Congress to complain. And they have found plenty of sympathy on Capitol Hill, where free parking remains a sacred right.

Four federal employe unions went to U.S. District Court here yesterday, charging that President Carter's comments in a speech on energy last April "do not constitute a legal basis" for levying parking fees.

The American Federation of Government Employees, which bargains for 700,000 federal workers, and several other AFL-CIO affiliates contend that the General Services Administration and the office of Management and Budget got carried away in trying to enforce the president's wish to encourage federal worers to get out of their cars and on public transportation. The unions asked the court to declare the charges -- estimated to produce $20 million the first year -- illegal and to give the money back to the workers with interest.

There is little indication that anyone expects the order to bring a surge of new riders to public transportation locally. Metro, which operates the bus and subway system in the area, isn't adding a single new bus or train.

The major effect of the order has been the printing and sale of permits that show a monthly parking fee has been paid, which in Washington ranges from $45 a month for some leased indoor spaces downtown to $10 for the 10,003 outdoor spots at the Pentagon.

The rates were established after appraisers employed by the various federal agencies conducted surveys of comparable commercial rates, then cut them in half.

Full rates will go into effect Nov. 1, 1981. Where the commerical rate was found to be $10 or less per month, no charge is being imposed, resulting in free parking at places such as the Central Intelligence Agency in Langley.

At the White House, a memo circulated earlier this week warned commuters that cars without stickers would be ticketed, and perhaps towed, by the Secret Service.

The fee for parking in a reserved slot inside the gate is $37.50. Outside the gate, the charge ranges from $18.50 on the Ellipse to $23.50 on State Place, behind the White House. Perhaps to encourage early arrival at work, the president has authorized his parking attendants to sell more permits than the 1,200 spaces available.

High-ranking officials who come to work in a government-owned vehicle, often driven by a government-employed driver, won't have to pay because of a clause that exempts government-owned vehicles.

Other exemptions apply to two-wheeled vehicles, van pools with at least eight riders, handicapped drivers, federal judges and, of course, members of Congress.

An aide to Rep. Michael D. Barnes (D-Md.) said, "What's really upsetting them [federal workers] is that the money is going to the treasury. They feel like they are being used to try to balance the budget."

Reps. Harris and Barnes and other area members of Congress sent a telegram to the president urging him to reconsider the order, saying "it will clearly not save any energy to impose parking fees at federal facilities where employes have no alternative transportation to the private automobile."