Classics are classics for a number of reasons. They have universal themes that transcend time and place. Go ahead and read the Wikipedia entry for Russian history if you want to give yourself a bit of background, but ultimately you will enjoy Dostoyevsky or you won't. Funnily enough, I read a bunch of him while in my late teens/early twenties. I didn't read the majority of my books on Russian history until later
As for Tolstoy, I began with War and Peace. And only last year. Did I know everything about the reign of Alexander I and about Napoleonic Europe? No. But I knew enough for the background to make sense. Tolstoy will fill you in on what you need to know.