I know Russia has been, but what about the city specifically?
Moscow was attacked and conquered six times in its history by foreign armies.
Moscow was sacked by the Mongols in 1237-1238, burnt to the ground and most of the people killed.
In 1382, Khan Tokhatamysh of the Golden Horde sacked Moscow again to crush rebellion.
In 1571, 120,000 Crimean Tartars (with some Ottoman allies) sacked and burned Moscow (which was packed with refugees from outlying areas), killing 80,000, and taking 150,000 Russians as slaves.
In 1610, the Swedish Army occupied Moscow. This may or may not count, as the Swedes were fighting to help Tsar Vasili Shuiski, against the rebels who held Moscow.
In 1611, the Swedes had withdrawn, but the Polish – Lithuanian army invaded and took Moscow.
Napoleon captured Moscow in 1812.
That was the last time that a foreign army captured Moscow.