Russia's defence ministry said it was ready to hit "decision-making centres" in Kyiv should such attacks occur.
The presence of Western advisers at such centres might not affect its decision to retaliate, it added.
It comes after a UK defence minister said it was "not necessarily a problem" for Ukraine to use UK-supplied arms against military targets in Russia.
James Heappey said Ukrainian military strikes to disrupt supply lines were a "legitimate" part of war, and described Russian claims of Nato being in conflict with Russia as "nonsense".
Russia has claimed Ukrainian forces have attacked targets within its territory, including an oil depot in Belgorod, but Ukraine has not confirmed any strikes.
Western countries have donated hundreds of millions of pounds of military aid to Ukraine since Russia launched its invasion back in February, and Nato and European Union officials have been meeting in Germany to discuss further military assistance.
The UK government has announced it will give Ukrainian forces a small number of anti-aircraft vehicles.
In a statement quoted by the Interfax news agency, the Russian defence ministry said: "We would like to stress that the direct provoking by London of the Kyiv regime into such activities [attacking Russian territory], should there be an attempt to realise them, will immediately lead to our proportional response."
The ministry also said Russian armed forces were ready to "deliver retaliatory strikes using long-range high-accuracy weaponry" against "centres taking relevant decisions" in the Ukrainian capital Kyiv.
"The advisers from among the subjects of one of the Western countries that are located in Ukrainian decision-making centres in Kyiv will not necessarily be a problem when Russia decides to take retaliatory action," the ministry said.
Foreign minister Sergei Lavrov also accused Nato of conducting a proxy war, and said Western weapons being delivered to Ukraine would be fair targets.
Mr Lavrov claimed the West was "pouring oil on the fire" by providing Ukraine with firepower, and repeated warnings that the conflict could lead to a third world war.
But Mr Heappey told BBC Radio 4's Today programme it was Ukraine that makes the decisions of where and what to target, rather than the countries or companies that manufacture and export the weapons.
Mr Heappey added: "It is entirely legitimate to go after targets in the depth of your opponents to disrupt their logistics and supply lines."
He added that it was also a legitimate part of war for Russian forces to be striking targets in western Ukraine to disrupt Ukrainian supply lines, as long as they avoided targeting civilians - "which unfortunately they have not taken much regard for so far".
UK defence sources later sought to clarify Mr Heappey's remarks, who also told Times Radio it was "not necessarily a problem" for British-supplied arms to be used by Ukrainian forces against military targets in Russia, after acknowledging that weapons now being supplied have the range to be used over borders.
The sources said the UK was not involved in Ukrainian targeting, and the minister's use of the phrase "deep strike precision targeting" referred to stopping the relentless bombardment of Russian artillery, not striking targets in Russia.
"The UK and many other Western allies are now providing longer-range weapon systems to help counter the indiscriminate artillery fire that the Russian armed forces have been raining down on besieged Ukrainian cities," the sources told the BBC.
"Targeting is a matter for Ukraine, but the UK expects all parties in this conflict to decide on their military targets in full compliance with the laws of armed conflict."
Later, Prime Minister Boris Johnson was asked in a Talk TV interview if he was happy for British weapons to be used against targets like oil refineries within Russia - and he replied that Ukraine had a right to defend itself.
"We don't want the crisis to escalate beyond Ukraine's borders," he said.
"But the Ukrainians, plainly, as James [Heappey] has said, they have a right to defend themselves. They're being attacked from within Russian territory... they have a right to protect and defend themselves".
Ukraine is fighting an existential war with Russia so it is unsurprising Ukrainian forces should target supply lines over the Russian border.
It is equally unsurprising Western powers are relaxed that some of their weaponry are used in such strikes.
What is interesting about James Heappey's remarks is their frankness.
In other conflicts, such as in Yemen, British ministers tend to be coy about the use of British weapons.
On one level, the defence minister is just revealing his usual candour. He often speaks more as a former soldier than a politician.
But on another level, his remarks reflect Nato's deepening involvement in this conflict.
The weapons provided by Western powers are getting bigger and more powerful.
It is one thing to give Ukraine short-range anti-tank bazookas. It is another to provide them with drones and artillery that can cross borders.
The line between defending Ukraine and attacking Russia is increasingly blurred.
For months, Ukrainian President Volodymyr Zelensky has been asking Western allies for more weapons to fight off the Russian invasion.
On Monday, Defence Secretary Ben Wallace announced the UK would gift a small number of Stormer vehicles fitted with launchers for Starstreak anti-aircraft missiles to give Ukrainian forces "enhanced, short-range anti-air capabilities both day and night".
He also told the Commons around 15,000 Russian troops had been killed since Russia launched a full-scale invasion of Ukraine, while 2,000 of its armoured vehicles had either been destroyed or captured.
Meanwhile, Mr Johnson has said he does not expect Russia to use nuclear weapons in Ukraine, even if President Vladimir Putin suffered more military failures there.
The prime minister told TalkTV he thought Mr Putin had enough "political space" to back down and withdraw, given the "overwhelming" support he enjoys in Russia and the "apparent obliviousness of the Russian media".