Chrysler Corp., which this week averted a strike over a wage dispute with hourly workers, yesterday reported a third-quarter profit of $9.4 million (3 cents a share) compared with a $140.1 million loss in the comparable period last year.

However, the profit by the No. 3 automaker was due not to successful car sales but to a federal tax credit of $20.7 million. Chrysler sustained an operating loss of $11.3 million for the quarter.

Meanwhile, Johnson & Johnson Inc. reported that the national withdrawal of its Tylenol pain-reliever capsules reduced third-quarter earnings by $50 million (27 cents a share).

The pharmaceutical giant, which was on the way to one of its best years in history before poisoned Tylenol capsules killed seven people in Chicago, said that its net profits for the quarter were down 26 percent from the year before.

And Texaco Inc., the nation's third-largest oil company, said yesterday that earnings tumbled 48.7 percent in the third quarter because the worldwide recession has slowed demand for petroleum products.

Chrysler Chairman Lee Iacocca noted in a statement that this is the first time since 1977 that the automaker has recorded three straight profitable quarters.

It also was the first time in five years that Chrysler has reported a profit in a third quarter, traditionally the industry's worst because of new-model changeover costs. The last third-quarter profit was in 1977, when the company made $33.7 million.

This year's nine-month earnings were $266.2 million ($3.23). Chrysler lost $408.7 million ($6.21) during the same period last year.

Chrysler reported worldwide sales in the third quarter of $2.5 billion, up from $2.3 billion last year. Worldwide vehicle factory sales in the quarter were 284,601, off 2.3 percent from 291,403 last year.

Nine-month sales totaled $7.8 billion versus $7.4 billion last year. Worldwide vehicle factory sales were 926,152, compared with 981,938.

Johnson & Johnson Inc. said that earnings for the quarter before the $50 million charge were $146.5 million (78 cents a share) compared with $129.9 million (69 cents) last year. The $50 million charge shaved the figure to $96.5 million (51 cents). Sales were $1.48 billion against $1.34 billion.

The recall costs aside, nine-month net profits would have been $444 million ($2.37), up 17.2 percent from $378.9 million ($2.03) a year earlier, the company said. Because of the extraordinary expense, however, the figure slid to a 4 percent increase from the first nine months of 1981 to $394 million ($2.10). Nine-month sales were $4.38 billion, up 9.3 percent from $4.01 billion.

Johnson & Johnson spokesman Robert V. Andrews said the withdrawal of Tylenol capsules will negatively affect Tylenol sales and overall company earnings in the fourth quarter and "into 1983."

Andrews said he could not project what the overall impact would be for the company. He added that the company is designing a tamper-resistant package and plans to invest heavily to reestablish the pain reliever on the market.

Tylenol was the best-selling nonprescription pain reliever in the country prior to the Chicago poisonings.

Texaco Inc.'s third-quarter earnings plummeted to $303 million ($1.16 a share) from $589 million ($2.25) in the third quarter of 1981. Revenues were off 18 percent to $11.8 million from $14.4 million.

Nine-month earnings were $975 million ($3.74) compared with a record $1.8 billion ($6.79) in the same 1981 period. Revenue fell to $36.3 billion from $44.7 billion.

Texaco's U.S. energy earnings fell 38 1/2 percent to $156 million, primarily on lower oil and gas production, reduced crude-oil prices and higher dry-hole expenses. Foreign energy earnings were down 53.2 percent, reflecting continued high costs of acquiring crude oil.

High interest costs and losses on foreign currency translations produced a net loss of $28.9 million for Pan American World Airways in the third quarter in contrast to a profit of $281.5 million ($3.95 a share) a year ago, the airline reported yesterday.