I am not very good at grammar. Is there someone who would go through and correct your grammatical mistakes, even if you are not good at grammar? Who would this person be?
The problem is that there are so many people out there trying to get published who ARE good at grammar. If an editor is looking at your manuscript and at an MS with an equally good story, characterization, writing style, etc., but with better grammar, the editor is going to chose the story with better grammar.
So before submission, you could try to find an editor to fix the issues for you, but you'd be VERY lucky to find anyone willing to do it for free, and you might find that some of the corrections affect the style of writing you wanted.
It's not impossible to be selected for publication even if a lot of work is needed to make your MS publishable, but everything else about your work will have to be that much better in order to make up for the grammar deficit.
Yes, you should be good at grammar to expect to get published. It's highly unlikely you will get your foot in the door if your manuscript has basic grammatical errors from the outset, because this will detract from your overall story. From a business perspective, poor grammar can also mean it may cost someone more money to publish your book, because it would need a lot more editing compared to someone who has taken the time edit their own work, and fix the grammar as best as possible.
Edit: Forgot to add that, obviously, you yourself could pay someone to edit the work for you, but you definitely need your manuscript at a reasonable standard to expect to get published.
Let me be harsh but direct: I very sincerely doubt that someone who's not good at grammar is a good writer.
Not because grammar is somehow an ineluctable part of good writing -- it isn't -- but because good writing is writing that rings true in the reader's ear, and good grammar is good because it rings true. Let me give you an (admittedly contrived) example:
Not knowing anyone there, the party was boring.
Hearing that, the grammarian will shriek “Dangling participle! Dangling participle!” like a car alarm going off. That's not, by itself, important.
What is important is that the reader, hearing that, will say, “What? Huh? ‘Knowing’ ... ‘party’ ... I doan get it. I wonder what’s on ESPN ...”
The writer who dangles a lot of participles is going to get a lot of his readers watching Sports Center, because reading bad writing is a chore and it’s more fun to watch TV.
The grammarian -- even that inner grammarian who complains not only about real mistakes like misplaced modifiers and subject-verb disagreement but also about split infinitives and sentences beginning with conjunctions -- that guy who sits on your shoulder and tries to suck the fun out of writing is really your early-warning system. When he says this-or-that is ungrammatical, what you should hear is, people may not read it. And he may be wrong, but he may be right.
I think that grammar is important, but more because you may have trouble expressing yourself in the way you intended without it. Books are full of characters with poor or unusual grammar, but that should be a conscious choice. Picasso may have created simple, abstract works - but he had a thorough mastery of craft first.