The tax dispute in which the Internal Revenue Service is challenging a $666 million writeoff by the Federal National Mortgage Association will be followed by a plethora of similar tax cases against savings and loan associations, industry officials said yesterday.

Already, one case is awaiting a judge's decision in Cincinnati, 12 cases are ready to be heard in U.S. Tax Court here and many more are moving through the IRS's administrative appeals process on their way to court.

The taxes and interest that the IRS says the S&Ls owe may exceed $1 billion.

"There are a bunch" of S&L cases pending, said Brian Smith, director of regulatory operations for the U.S. League of Savings Institutions. "An awful lot of institutions got into these transactions."

Like the Fannie Mae case, which is being tried this week in U.S. Tax Court, the S&L cases arise from a series of mortgage swaps that many financial institutions undertook when interest rates were rising in the early 1980s.

Higher interest rates made the low-rate mortgages that the S&Ls and Fannie Mae were holding worth less than their face value. To obtain a tax deduction from that loss in value without actually losing money, the lenders arranged to sell their mortgages to other institutions and then buy back similar packages of low-rate loans. The sale of the below-market mortgages in 1980 and 1981 generated tax losses totaling $265 million for Fannie Mae.

The government is also challenging another $341 million in writeoffs Fannie Mae claimed from a different type of tax transaction.

Fannie Mae officials have not disputed during the trial that reducing taxes was one of their priorities, and their accounting firm apparently offered the swap transactions to other clients as well.

A 1980 internal memo from Peat Marwick Mitchell & Co. to all its U.S. offices describes the deals as "a significant opportunity for many of our financial institution clients and prospective clients to reduce or eliminate current-year income taxes and perhaps also recover federal income taxes for the prior 10 taxable years." The memo invited the accountants to find clients interested in mortgage swaps with a "Washington, D.C., institution that is seeking tax losses in the $750-$800 million range."

Some S&Ls and mortgage bankers participated in the deals with Fannie Mae, a private corporation chartered by Congress to raise money for home mortgages. Other S&Ls engaged in similar swaps with each other, sometimes in three- and four-way transactions.

Although there are no precise figures available, the IRS appears to be challenging the S&L losses extensively. Officials said that most of the 71 S&Ls that swapped mortgages with Fannie Mae probably were under IRS examination or appeal.

In theory, experts said, the losses taken by the S&Ls ought to be about the same size as those taken by Fannie Mae, suggesting the 71 S&Ls took losses of more than $200 million. That total does not include losses claimed by S&Ls that swapped mortgages with each other.