South Africa built nuclear weapons in the 1980s:
https://en.wikipedia.org/wiki/South_Africa_and_weapons_of_ma...
But it never had an orbital launch capability.
Pakistan doesn't have a domestic orbital launch capability but it does have nuclear weapons.
Surprisingly, the United Kingdom doesn't have a domestic orbital launch capability at present though it has had ballistic missiles and nuclear weapons for many decades.
At present, I would say that building a basic implosion-assembled atomic bomb is easier than building a rocket system that reach low Earth orbit. It's a lot easier to build a bomb now than it was in the 1940s. The main thing that prevents wider nuclear weapon proliferation is treaties and inspections, not inherent technical difficulties.