An alleged Czechoslovakian agent, accused of spying against the United States while working for the Central Intelligence Agency, is expected to be included in next week's anticipated multination prisoner swap aimed at freeing Soviet dissident Anatoly Scharansky, sources familiar with the arrangements said yesterday.

The sources said the Reagan administration has agreed to release Karl F. Koecher, 52, and his wife, Hana, 42, as part of the exchange that is expected to take place in Berlin, probably on Tuesday.

In addition to Scharansky, a Soviet Jew and computer scientist who has been jailed for more than seven years on espionage charges, the swap is expected to involve 12 West German counterintelligence agents being held in Eastern Europe as well as several East German spies imprisoned in West Germany. Koecher, who had worked as a contract translator and consultant to the CIA from 1973 to 1975, were arrested in New York on Nov. 27, 1984, while preparing to fly to Switzerland. He was indicted on a federal charge of conspiracy to commit espionage for Czechoslovakia and had been awaiting trial in New York.

However, the sources, who declined to be identified, said that he reportedly had pleaded no contest, which is tantamount to a guilty plea, at a recent secret court proceeding in New York and was sentenced to time served since his arrest on condition that he is swapped for Scharansky.

His wife, who also had been detained, was held as a material witness but was not charged with a crime, reportedly because FBI agents tainted the case by holding her for questioning without allowing her to see a lawyer.

Koecher is one of only two alleged communist agents to have been apprehended after working their way inside the CIA. The other, Larry Wu-Tai Chin, was found guilty yesterday by a federal jury in Alexandria of spying for China.

There also were reports yesterday that Dieter Gerhardt, serving a life sentence in South Africa as a Soviet agent, would be included in the swap.

But the newspaper Die Burger, which is regarded as an authoritative spokesman for the South African government, quoted senior officials there as denying that Gerhardt would be released.

U.S. government officials have refused to comment on the anticipated release of Scharansky, whose plight has received international attention.

However, the sources said the administration, as a gesture to help ensure the swap, had agreed to include Koecher, who is the only East Bloc agent now held by the United States.

The sources added that Wolfgang Vogel, an East German lawyer who is involved in negotiating the exchange, had sought to win Koecher's release as part of an earlier prisoner swap. But on that occasion, the United States refused to let him go, the sources said.

If the Scharansky swap takes place, it would be the third prisoner exchange involving the United States in less than a year. On June 11, four East Bloc spies were exchanged in Berlin for 25 western agents and their relatives.

On Nov. 28, the United States swapped a relative of Ghana's military leader for eight accused U.S. agents and their families held by that African country.

The swap last June took place at the Glienicke Bridge, which connects West Berlin with the East Berlin suburb of Potsdam; next week's anticipated exchange is expected to occur at the same site.

The sources said that if Scharansky is released, tentative plans call for him to be taken immediately to Frankfurt, West Germany, where he will be transferred to a flight to Israel.