They are quite similar. Realizing means you suddenly think of something, saying "it never dawned on me before" sounds like something you had known for a long time but did not realize until now. They could mean the same in certain contexts, but they don't necessarily.
For example, you wouldn't say "it never dawned on me that I had forgotten my wallet" unless you were telling a story in which that was an important detail. You might say "I suddenly realized that I forgot my wallet".