General spoilers without stating explicitly who dies/survives ahead
No, you can't do everything since the factions destroy each other.
What faction are you planning on sticking with? Just the one that you can get the most content getting to? You can go up to a quest called Mass Fusion and complete all faction quests so far without causing one to become hostile. Before you do any objectives at all in Mass Fusion, it's imperative that you do Liberty Reprimed first for maximum content. Mass Fusion requires you to make either the Institute or the BoS hostile. If you make the Institute hostile, you can't progress the storyline quests for the Railroad and can start working directly with the Minutemen against the Institute instead. If you make the BoS hostile, you can still keep progressing the Railroad storyline. I would say that the Railroad storyline is more interesting, and you get a guaranteed medium size fight with the BoS, whereas there is a moderately large sized battle involving the Minutemen vs. synths, though I don't think the MM battle is worth it since there's no quest content. At that point, you just kind of choose which faction you want to destroy with which faction. I do not recommend choosing the Minutemen to destroy any faction. Siding with the Institute gives you a more interesting battle than siding with the Institute in my opinion. I haven't played out the BoS ending yet, but remember that you do lose out on a little bit of Railroad content if you do choose to go that route.