LONDON (AP) _ Prime Minister Margaret Thatcher said Britain must retain nuclear weapons because without them Soviet leader Mikhail S. Gorbachev could threaten Western Europe.

Soviet superiority in conventional and chemical weapons would guarantee Gorbachev ''would get what he wanted,'' Mrs. Thatcher said on commercial television's ''News at Ten'' Thursday night.

Three hours earlier on another commercial television newscast, Soviet Foreign Ministry spokesman Gennadi Gerasimov said he did not accept Mrs. Thatcher's view that British nuclear weapons were vital to Western security.

''I don't accept this because we want to see the world nuclear-free and we cannot see it nuclear-free if Britain is going to keep her nuclear forces,'' he said.

Gerasimov said although the United States and the Soviet Union want to get rid of nuclear weapons, the British did not.

''We are believers, you are non-believers. You do not believe in a nuclear- free world. So our task is to convert you to our faith,'' he said.

Asked about this later, Mrs. Thatcher responded: ''I want a war-free Europe. A nuclear-free Europe I do not believe would be a war-free Europe.''

She added, ''The nuclear weapon has kept the peace in Western Europe for 40 years.

''Of course Mr. Gorbachev wants to get rid of nuclear weapons out of Western Europe because he knows that if he does, the enormous superiority he has got in men, in tanks, in aircraft, in all conventional weapons, and the colossal superiority in chemical weapons, would mean that if he got the nuclear weapon out of Europe, we would never be able to deter an aggressor.''

Mrs Thatcher said: ''He could almost threaten, and he would get what he wanted. It's my job, as head of government, to see that no one who wants to threaten Western Europe has any chance of succeeding.

''The only way to do that is to see that we have a sure defense.''

She concluded: ''You are not sure because of your own virtue. You are sure because the men, the materials, the weapons, including the nuclear, are there.

''And if you make a mistake now it may not affect our generation, but it may affect future generations because one mistake will take 10 or 12 years to recover.''