More likely, Ukraine won't be willing to do the things it would need to do in order to be allowed into NATO (like, say, dropping claims to Crimea). But if it does go such a long way, all bets are off.
Its a lot of real estate and people, and some strategic significance, like more control over Black Sea and land connection to contested territory of Transnistria, which in turn can cause problems for Romania, NATO member, and Moldova, NATO candidate, nevermind add direct Russia border to several NATO countries.
Long story short, it would be much cheaper to break, or at least mire Russia's military in Ukraine, than wait for it to start messing with more vulnerable NATO members in several different points from Scandinavia to Turkey, which, if emboldened by a major success in Ukraine, it may well do.