The difference between the two is one of style, were(n't) being more formal than was(n't).
The authors of 'The Cambridge Grammar of the English Language' (Huddleston and Pullum) go so far as to say that this verb form isn't subjunctive at all, preferring to describe it as irrealis. As they say:
This use of were is highly exceptional: there is no other verb in
the language where the modal remoteness meaning is expressed by a
different inflectional form from the past meaning. The irrealis mood
form is unique to be, and limited to the 1st and 3rd person
singular. It is an untidy relic of an earlier system, and some
speakers usually, if not always, use preterite was instead.
So, to answer your question, there's nothing wrong with If it wasn't for holes, a bagel would be a bun and for many native speakers it will be the natural construction to use.
EDIT:
As further explanation in the light of the comments below, here’s Huddleston and Pullum’s footnote on the subject:
Traditional grammar calls our irrealis a ‘past subjunctive’,
contrasting with ‘present subjunctive’ be. But there are no grounds
for analysing this were as a past tense counterpart of the be that
we find in constructions like It’s vital that he be kind to her. We
don’t use ‘subjunctive’ as a term for this inflectional category, but
for a syntactic category employing the plain form of the verb.
For balance, I’d better also quote the following from ‘Oxford Modern English Grammar’ by Bas Aarts, published in 2011:
This form [were] of the verb BE, in the first or third person, can
be seen as a relic of the past subjunctive.
And later:
. . . modern English does not have a subjunctive mood to speak of. It
therefore makes little sense to speak of the ‘present subjunctive’
forms of English verbs, simply because they cannot be distinguished
from the plain forms . . . English also does not have past subjunctive
verb forms . . . The only exception is the verb BE which has the past
subjunctive form were for the first and third person singular . . .
This is the only true remnant of a subjunctive form in English.
In the course of his discussion, Aarts acknowledges the preference in American English for constructions such as I urged in my previous letter that these research staff be treated as their present colleagues. He contrasts this with Some water boards insist that all cold water taps in the house are taken from the rising main, suggesting that ‘this construction is barely used in American English’.