no it doesnt have to be... but if possible should be.
If you are putting a new toilet into an existing house and not at an external wall, then you are in for a world of work.
Unless you can run the new soil pipe across a floor and out, you need to rip up existing concrete floors.. .and pipe through existing rising walls.... not for the fain hearted.
You can put a toilet in anywhere these days, Saniflo make "small-bore solids-muncher" type things that can pass the waste out through a 3/4 inch pipe. it can pump the waste up,over or whatever from en-suite or wc. they do make noise though.