And I doubt that Germany would have united if they had lost the Franco-Prussian war (it may have politically united at a later date though, and the North German Confederation was pretty powerful on its own), although I don't think the French would have been able to win, at least not decisively given Napoleon III's leadership (he was effective at times, but he did not have the genius of Napoleon I). As Bismarck said when he visited France before the war 'I met two women when I went to France, the Empress and her husband' or words to that effect.
People forget that Germany, Austria-Hungary and Russia formed the 'League of the Three Emperors' that only really broke down when Wilhelm II took the throne (It had technically gone a little bit before then but any hope of renewal was killed off when Bismarck was sacked) so an alliance with France was not assured, although Tsar Alexander III never really did like the Germans. The alliance system does get very confusing when Bismarck was involved (there was a pact between Germany, Italy and the UK and of course the triple alliance between Germany, Austria-Hungary and Italy). I am of the opinion that Bismarck created all these confusing alliances so that a war would not break out because no-one would have any idea what alliance they belonged to!
The main way WW1 could have been prevented would be if the Russians had taken Plevna sooner in 1877-78, thus dealing with the 'Eastern Question' a bit sooner.