The Russian president said such a policy, which he branded "aggressive" and "irresponsible", was a direct threat to the country's national security.
Speaking to Russian diplomats in Moscow, Mr Putin condemned what he said was Nato's attempts to deploy new bases and military infrastructure near Russia's borders, adding there was a need to restore trust in Europe.
The issue has been a source of anger for Russia - which shares a border with both countries and does not want to see them join what it regards as a hostile military bloc - since 2008, when Nato leaders promised Ukraine and Georgia they would one day become members of the alliance.
"We will respond appropriately to such aggressive steps, which pose a direct threat to Russia," Mr Putin said on Thursday.
"Our colleagues, who are trying to aggravate the situation, seeking to include, among others, Ukraine and Georgia in the orbit of the alliance, should think about the possible consequences of such an irresponsible policy."
The revelation came amid growing pressure on the White House to provide a full account of Mr Trump's two-hour private meeting with his Russian counterpart.
Some Democrats have pushed for the US translator in the room to provide an account to Congress after Russian officials said "important verbal agreements" had been made.
Mr Trump has called on Nato members to increase their contributions to the alliance, but has queried whether Montenegro, the alliance's newest member, should be part of the bloc at all, calling its people "aggressive".
Russian forces entered two breakaway Georgian regions in 2008 and annexed Ukraine's Crimea in 2014, after which a pro-Russian separatist uprising erupted in eastern Ukraine.
Swathes of both countries remain garrisoned by Russian troops, something Moscow says is in keeping with local people's wishes, but which the West and the governments of the two countries call an illegal occupation.
Nato leaders discussed ties with Ukraine and Georgia - both former Soviet republics once ruled from Moscow -- at their summit in Brussels earlier this month.
Prominent politicians in both countries are keen to join the Western military alliance, but have seen their chances of joining hampered by Russian territorial incursions.
Under Nato rules, countries with territorial conflicts cannot join the alliance.
Additional reporting by Reuters.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies