Conoco Inc. and Cities Service Co. yesterday halted trading in their stock amid speculation the two oil companies, ranked 9th and 19th in sales, were discussing a merger.

Both companies requested the trading halt before the opening of the New York Exchange. The similar wording of the announcements they made at the same time, and the fact that both want to escape unfriendly takeovers by Canadian suitors, triggered immediate speculation among market analysts that a merger was in the works.

Investors also turned to a Monday announcement by Conoco that it had approached another U.S. company that is "approximately similar in size" about a possible merger. With 1980 sales of $18.3 billion, Conoco is the 14th-largest industrial corporation in the United States. Cities Service stands at 44th with sales last year of $7.8 billion.

Together, the firms would replace Atlantic Richfield Co. as the eighth-largest oil company and would be the nation's 10th-largest industrial corporation, replacing General Electric Co. in the top 10.

Unfriendly takeover attempts may be the most important single motivation behind any merger. "What you have here are two companies that are under the gun," said Robert Morris, an oil industry specialist with the New York securities firm Drexel Burnham Lambert.

Conoco appears to be fighting a takeover attempt announced Monday by Canadia distiller Joseph E. Seagram & Sons Inc. Seagram said it would attempt to buy a controlling 25 percent stake in Conoco for $2 billion, or $70 a share for 28.6 million shares. The world's largest producer and marketer of distilled spirits, Seagram has been flush with cash since it sold its U.S. and gas holdings to the Sun Oil Co. for $2.3 billion.

There was no immediate explanation why Seagram was interested in buying a U.S. oil firm so soon after selling its Sun holdings. But it is possible Seagram may be interested in Conoco's large coal operation. Conoco owns Consolidation Coal Co., the nation's second-largest coal producer.

The smaller Cities Service also is battling a takeover attempt from a Canadian company, the Calgary-based real estate and energy firm Nu West Inc. The rapidly growing Canadian firm -- with 1980 sales of $860 million -- owns 7 1/4 percent of Cities Service and wants more. Paul Zeff, an analyst with the Canadian securities firm Greenshields Inc., said yesterday that Nu West has its eyes on the American company's 18 percent interest in a massive Canadian tar sands project.

Analysts speculated that impending action by the Canadian government to restrict American investment in Canadian companies, and especially in oil and gas, would ease any antitrust problems from a merger.

"The antitrust opposition that might surface to this might be less than it would othewise," said Eugene Nowak, an analyst with Dean Witter Reynolds in New York. Canadian Prime Minister Pierre Elliot Trudeau has put forward a program to "Candianize" that nation's oil and gas industry and is expected to come up with proposals soon to put curbs on foreign subsidiaries. Analysts said that the resulting backlash among U.S. officials could put the government's stamp of approval on a merger such as Conoco and Cities Service.

Most market experts agreed that a combination would take the form of an amalgamation in which the two firms would form a new entity.

Analysts said the companies complement each other in key areas. "Cities has for a long time been anxious to get into the coal business," said Nowak of Dean Witter Reynolds. Cities' coal holdings are minimal. Nowak said the coal alone added "some believability" to rumors of merger talks.

Conoco, for its part, may be interested in the land to which Cities has rights for oil and gas exploration. "Cities Service's big plus is its 11 million acres in domestic leases," said Robert Levine, an analyst with E.F. Hutton in New York. Nowak said combining the two firms' exploration programs could improve their records in finding oil and gas. Cities has been criticized for a poor exploration record on its sizable acreage, and Conoco's ability to find oil is considered equal to the average in the industry.

Put together, said Nowak, the two companies would have the third-largest acreage position in the U.S., after Exxon Corp. and Standard Oil Co. (Indiana).

Conoco was the target of another Canadian takeover attempt last spring. Dome Petroleum Ltd. of Calgary, one-third Conoco's size, bought 22 million Conoco shares in an unfriendly tender offer, then gave the shares back to Conoco in return for Conoco's Canadian oil and gas interests and $245 million cash. Canadian analyst Zeff said that a similar move against Cities Service may be what Nu West has in mind.