PAKISTAN'S NEW prime minister opens his Washington visit on the heels of a report that the Soviets have warned Pakistan it had better not build a nuclear bomb, something it seems increasingly prepared if not inclined to do. Why might Moscow put in its two cents' worth? One possible reason -- not one Americans need credit -- is that the Soviets tilt to India in South Asia's basic local rivalry. But there is a worthier consideration. Moscow has no less an interest than Washington in keeping small countries from acquiring nuclear weapons, lest they create difficulties -- start a war -- that could affect the whole world. Pakistan should not be building a bomb. President Reagan ought to underline the point to Prime Minister Mohammed Khan Junejo when he greets him this morning.

Mr. Reagan has a good record on pressing nonproliferation on Islamabad. He has kept American concern before the Pakistani leadership, including the real power, President Zia. He has wielded on Pakistan the leverage, legislated by Congress, requiring him to certify as a condition of aid that the country does not ''possess'' an atomic bomb. Most important, Mr. Reagan has seen to it that American policy offers a practical alternative -- American patronage -- to the sort of geopolitical loneliness that drives a small, isolated and dangerously situated country such as Pakistan -- whose principal regional rival, India, long ago exploded its own bomb -- toward going nuclear itself.

Nonetheless, Pakistan may be moving relentlessly that way. Incorrectly, we believe, it may be calculating that its support of the Afghan resistance, its start back toward elected government and its strategic utility will induce the United States not to push it too hard on the nuclear question. It can observe that India basically paid no large price -- rather the contrary -- for its nuclear assertiveness. Not just the military types but Pakistanis of different persuasions tend to underline the interests they share with the United States, but they also see the United States as a country of shifting political moods and one that, in any event, is a long distance away.

It will take more than cautions from Moscow and Washington to ensure that Pakistan and, of course, India limit their respective nuclear programs. It will take a Soviet-American consensus on regional stability and uncommon and parallel statesmanship by the regional parties. Meanwhile, the United States cannot afford to stop trying to contain the nuclear genie threatening to break loose on the Asian subcontinent.