Should the closet flange be set on top of a tile floor or on the wood so the tile is brought up to the flange but is not under it?

Closet flanges should always have the bottom of the flange resting on top of the finished floor. So to answer this specific question, the tile should be under the flange and the flange should be secured to the subfloor.