Most tanks will have some movement. If it doesn't leak, then why worry.
If the rough-in is at 12", you will likely see 3/4" of space behind the tank, which varies between toilets. Some plumbers will rough in at 12.5" just in case a homeowner decides to have tile or wainscoting behind.
If the rough-in is not at 12", several things could have happened.
There maybe something like a floor joist, pipe, vent, foundation wall in the way.
It could be the wall was moved from the plans, or missed, or framed with a different dimension, sheath with added or less material.
I would rather the tanks not touch the wall. I like air movement around the porcelain.