I think it will turn out that both sides are the official "answer." Whatever side the Dragonborn sides with will turn out to be the right one. If the Dragonborn sides with the empire, s/he will eventually lead the empire back to health and defeat the Aldmeri Dominion as a great hero. If the Dragonborn sides with Skyrim, then s/he will eventually lead Skyrim into the collapsing sections of the empire and defeat the Aldmeri Dominion.
The Dragonborn has impressed gods and dealt with daedra. No matter who you side with as the Dragonborn, I don't think you're going to play second fiddle for long. Ulfric would soon be overshadowed by a Dragonborn who will come to lead Skyrim (if sided with Stormcloaks) and I think it is inevitable you lead the empire if you side with them (especially since
the Emperor is assassinated by the Dark Brotherhood no matter who wins).
As another poster mentioned, in the end it won't matter who 'won' this war. All the histories will record is the return and rise of The Dragonborn. After I beat the game (which I've done a few times now), I'm itching to go frag some Altmeri butt. Hopefully I won't have to wait until Elder Scrolls VI to do it!
It's a bit more complicated than allied...
The short version is this: A few years back, there was a massive war between the Empire, and the Aldmeri Dominion, the latter is a kingdom of Elves, in which the Thalmor are basically the government, the army, the secret police, and the mages guild all rolled into one.
The Empire lost. Badly. The treaty that was signed to put an end to the war included a number of terms which were less than favorable to the Empire. Among them were the outlawing of Talos-worship throughout the Empire, and the allowing of Thalmor ambassadors, mages, and soldiers to inspect Imperial lands, and ensure that the terms of the truce were being adhered to.
So, while it's true that the Empire isn't actively at war with the Thalmor, and indeed, the fact that the Empire allows the Thalmor to wander about Skyrim killing Talos worshippers is one of Ulfrics primary grievances, calling the two allies is something of a stretch.
Indeed, if you end the Civil War on the Imperial side of things, General Tulius will remark
that the Empire will never be able to fight back against the Thalmor unless they can deal with and shut down various rebellion's like Ulfrics. And that once that's done, it will be time to deal with them.
Meanwhile, if you follow the Main Quest, at one point you'll get to raid the Thalmor Embassy and read their logs. Among other things, you'll learn that
Ulfric is essentially an 'agent' of the Thalmor. He may not actually be in service to them, but his rebellion is all a part of their plan - his Talos worship is the justification they need to return to war with the Empire in the future, and the rebellion itself weakens and fragments the Empire, making them easier prey in a future war of conquest.
Best Answer
Yes, it is possible. The main quest is not completely independent of the war, but it does not require your character to take any action to support or oppose either side in it. You won't need any advice or hints as to how to avoid taking a side; the game will tell you what you need to know when you get there. I hadn't realized it before, because I wasn't in this situation myself, but some thought seems to have gone into making this work out.