The flange is at the toilet's drain. The base of the toilet, well, it's the base of the toilet.
As for the gap at the flange, you could caulk it. Just clean it as best you can. When you set the toilet back on the flange (with the wax ring too), I say caulk. Why, you ask??! Well, if you cauled the toilet base, if it ended up rocking a little, then over time, it will crack and you'll have a rocker instead of a toilet! If you caulk the base, it will 'give' enough and pretty-much flex back in place. I've shimmed them before, then cauled, if they rock even BEFORE I caulk it.
Be sure to seal the grout under the toilet before you finish installing it. You know what will happen if you don't.