They are both ok, but there's a difference in meaning.
"We're of the same age" means "We are roughly the same age".
"We're the same age" means you are much closer in age than just 'roughly'. "We're the same age" implies a much shorter difference in age - you are the same age or just a couple of years difference. This is a little subjective, of course.
Also, "We're of the same age" isn't heard much. More natural (or more common, at least) to say instead, "We're roughly the same age".