People don’t speak with perfect grammar (except for your fourth grade teacher). So feel free to make your dialogue as colloquial as the character’s education and background dictates.
Narrative, however, should always follow the rules.
You might wonder whether that includes a character’s thought process (ie his/her internalizing or thinking, but not dialogue). The answer is yes. Follow the rules.