Both are grammatical, and both connect two events in sequence, but they work differently and have different meaning.
から is a relatively easy word for English speakers. It means "from", both literally and metaphorically (as in, drawing a conclusion from appropriate premises). ごはんを たべてから はを みがきます -> "because (I'm) eating food, (I will) brush my teeth".
あと is a noun; it's sometimes also listed as an adverb, but that really refers to the combination あとで. It's used in both spatial and temporal senses, so it means "area behind (something)" or "aftermath (of some event)" respectively. あとで is from what I've seen only used in the temporal sense, i.e. "after" - but more literally, "in (= during) the aftermath".
So this could be "Now that I have eaten food, I will brush my teeth". Or a more general observation (interpreting non-past as habitual present): "After I eat food, I brush my teeth."