I believe that war could have been prevented if the recently elected Abraham Lincoln had simply decided to allow the secessionist states to exist freely without military intervention. Had the Union troops within Fort Sumter vacated the fortress as requested to do so by the South Carolina government and the Confederate troops, it is likely that no further military combat would have been necessary. There was no reason for the Confederate troops to engage Northern soldiers, and no invasion of Northern states was planned by the Southern states. Simple recognition of the Confederate States of America would have prevented further bloodshed. Of course, Lincoln had no intention of doing this, and his primary goal once the war erupted was to reunite the entire country, including the seceding Southern states.
Of course, anything could have happened. However, given the history leading up to the Civil War, I would argue that the war could only have been avoided if one side or the other had given in completely.
During the decades that led up to the Civil War, the North and the South tried again and again to compromise on the issue of slavery. The compromises, for various reasons, ended up not working in the long run. It is very difficult to imagine what sort of further compromise could have been made in, say, 1860, to have prevented the war. Therefore, I would argue that once Lincoln was elected, the only way to avoid the war was for the South to give up slavery or the North to allow slavery to expand to any part of the country (and its territories that were not yet states) that wanted it.