Firestone Tire & Rubber Co., the nation's second-largest tiremaker, yesterday reported a loss of $32.1 million in the third quarter, compared with a $10.4 million profit for the same period a year ago.

The company said declining domestic vehicle production and a slump in replacement tire sales contributed to the loss.

For the nine months ended July 31, Firestone said it lost $97.8 million compared with the 1979 nine-month profit of $77.8 million when vehicle output and tire markets were stronger.

Firestone's loss in the quarter ended July 31 was on sales of $1.12 billion compared with sales of $1.31 billion (18 cents) in the same period a year ago. Sales for the first nine months were $3.62 billion compared with $3.87 billion in the same period last year.

Firestone said the loss was due mainly to a slowdown in domestic operations. Foreign operations showed improvement but not enough to offset U.S. losses, it said.

K mart Corp., hit by slackening demand and rising promotion costs, announced yesterday its second-quarter earnings fell 34 percent compared with the level one year ago.

Net income for the quarter was $59.2 million (47 cents per share), compared with $89.7 million (71 cents) for the second quarter of 1979.

Second-quarter sales were $3.47 billion, an increase of 14.2 percent from the second quarter of 1979, when they were $3.04 billion.

K mart Chairman Bernard M. Fauber said sales were strongest in small appliances, jewelry, home improvements, sporting goods and automotive items. Sales were less vigorous for ladies' apparel, major appliances and building materials, he said.

For the first half of 1980, K mart sales were up 14.1 percent to $6.45 billion from $5.66 billion a year ago. Net income was down 26.9 percent, falling from the year-ago level of $135.3 million ($1.08) to $98.9 million (79 cents).

Consolidated Rail Corp. reported a second-quarter loss of $39.1 million on revenues of $993.8 million yesterday and blamed the results on a drastic decline in traffic.

In the second quarter of 1979, Conrail reported earnings of $33 million on revenues of $1.04 billion.

Conrail said that in the second quarter of 1980, it had 20 percent fewer carloadings than it did in the same period of 1979, exceeding its forecase for the traffic decline.

Conrail said the slide in revenue and traffic mirrored the economic slump in the country and most specifically in the Northeast, the area served by Conrail.

The loss per share of common stock was $1.59 in the second quarter ended June 30 compared with earnings of $1.29 a share in the same period a year ago.

For the half, Conrail reported a loss of $123.88 million ($5) on revenues of $2.01 billion, compared with a loss of $91.98 million ($3.73) on revenues of $1.92 billion in the first six months of 1979.