I quote from WayToRussia:
It is only possible to apply for a Russian visa in the country
that you are a national of or in the country where you have a
residency permit valid for longer than 90 days. This means that if you
come from an EU country, you can apply for a Russian visa in any other
EU country, because you are entitled to permanent residence in any of
these countries by European law. However, if you're from the US, then
you can't apply in Finland, for example, unless you have a valid
residency permit there.
Therefore, if you're planning a long journey, you should always
apply for the Russian visa before you leave. It's possible to get a
tourist visa support at any moment before your journey, however, you
can only apply for a tourist visa not earlier than 90 days before the
date of your first entry to Russia. Business visa support can be
obtained not earlier than 45 days before your first entry to Russia.
These rules, introduced a couple of years ago, make it very
complicated to get a visa for Australian citizens who usually go on a
long journey through Asia and Russia into Europe and leave their
country earlier than 90 days before their travel (so they simply can't
apply in Australia, and the Russian consulate in China will not accept
their documents either because they don't have a residency permit
there. However, according to our own information, the consulates in
Austalia and New Zealand are often willing to make exceptions and
issue visas beforehand. But check with them first.
If you have a problem with this 90-day rule, there are several
ways to solve it.
First, you can apply for a Russian visa by post. Make sure you get
all the documents together first and once you're 90 days before your
journey, simply send it off to the Russian consulate in your country,
ask them to send it back to your address back home, and ask your
friends or relatives to forward the documents wherever you are at the
moment. This may not always work, though, because not all consulates
receive applications by post. In that case you could try to find a
local travel agency and send the documents to them, so they can apply
on your behalf.
Second, you can try to get a temporary residence in the country
where you want to apply. For example, if you are an American, you are
automatically entitled to stay 90 days in any EU country. So, say, if
you're staying in Russia on a multiple-entry visa and need to prolong
it, you would not be able to travel to Helsinki for a visa run,
because you don't have a residency permit for Finland valid for longer
than 90 days. The best solution in this case would be to either find a
country where as a US citizen you can stay longer than 90 days or try
to get a local residency. It's usually possible if you bring your bank
accounts to the local immigration office and tell them you need to
stay longer to start a business, for example.
Finally, there are some countries where the Russian consulates are
not that strict about the 90-day rule. You should always try to call
them before. Also, from our own experience, if you're getting a
business visa this rule is not so strictly enforced, so this may be an
option as well.
As I said the rules are theoretically strict, but sometimes there are exceptions.