A shower drain can be anywhere, as long as you properly slope the floor so that it drains, and does not leave standing puddles.
A toilet rough-in is measured from the wall BEHIND the toilet to the CENTER of the drain opening ( measure to the bolts). This dimension is usually 10" or 12". However, you cannot put a toilet that close to the SIDE wall. Your inspector will insist that this is done to code on any remodel.