Unfortunately, I'm vilified in the Legion, so I wasn't able to do any quests for them (except for the one given in Nipton (Cold, Cold Heart)). Sometimes when I look at reputation in my Pip-Boy some entries are gone and looking at the map I see Neutral standing with those factions, but as soon as I talk to an NPC the reputation is reverted to the original state (this may actually be a glitch in the game). Is there a way to finish Legion quests if they hate me? Furthermore - is it possible to finish side quests for both NCR and Ceasar's Legion if they hate each other so much?
If this is not a glitch, it may be because you are disguised as a member of a faction that is Neutral, but have been recognized when entering dialog.
If you haven't completed Ring-A-Ding-Ding yet, after completing it your negative reputation with the Legion and the NCR is going to be reset, so you can go to their quest trees. If you have become Vilified after completing Ring-A-Ding-Ding, there's no way for them to accept you again, and their quest line is going to fail.
Only some quests can be completed in the main quest line for each side before the other turns against you. As for the side quests, be aware that some quests inflict negative reputation on some reputations when they are solved.