The nation's foreign trade deficit narrowed dramatically last month after a massive bulge in January-resuming the gradual improvement that began early last summer.

Commerce Department figures showed that imports exceeded exports by only $1.3 billion in February-down sharply from the $3.1 billion red-link figure posted in January and well below December's $1.75 billion.

Importantly, there was a sharp drop in oil imports, which plunged 17.5 percent in February. In addition, overall U.S. imports fell 8.8 percent over the month, while exports rose a more modest 2.9 percent.

The steep decline in oil imports stemmed in part from the production shutdown in Iran, which significantly reduced the total amount of foreign petroleum that the U.S. was able to buy.

More than that, however, the dropoff also reflected an end to the heavy round of anticipatroy buying in December were trying to heat the Jan. 1 price boost scheduled by oil exporters.

It was that rush to get ahead of the price hike that bloated the trade deficit in December and January. Before that, the nation's foreign trade posture had been improving gradually.

The February figures marked a visible comedown. Even if the $1.3 billion deficit did not improve further in coming months. It would result in only a $15.6 billion deficit for the year-down sharply from $28.5 billion in 1978.

Moreover, the trade deficit would be all but offset by surpluses in services, foreign earnings, royalty payments and tourism, leaving the U.S. current account either in balance or in a small surplus.

The current account balance was in deficit only by $1.34 billion in the fourth quarter of 1978 - down from $3.71 billion in the July-Septetmber period, an annual rate of only $5 billion.

Both the trade and current account balances are turning in a far better performance than the Carter administration has predicted-a factor that should help to bolster the dollar, or at least slow any further decline.

Courtenay M. Slater, the Commerce Department's chief economist, said the trade figures "support quite clearly the conclusion that the balance is back on an improving trend" after the bulge in December and January.

Slater said she expected some small increase both in oil imports and the overall trade deficit in March, in part because of the increase in oil prices. But she forecast continued improvement in coming months.

Yesterday's figures showed overall imports down $1.4 billion over the month to a seasonally adjusted level of $14.8 billion. Exports rose $375 million, to a total of $13.5 billion.The statistics showed a sharp increase in U.S. exports of heavy manufacturing products, consistent with the recent jump in new orders for durable goods. Shipments of machinery and transportation equipment rose visibly. The February deficit was expecially low when contrasted with that posted 12 months earlier, when the U.S. racked up a record $4.3 billion red-ink figure that sent the dollar into a steep decline.

Separately, the department reported that the U.S. bilateral trade deficit with Japan also narrowed in February, to $782 million, from $1.03 billion in January.