Replaced my Thetford with a Dometic 320 this past fall because I didn't want to risk the consequences of another Thetford's foot pedal coming off and spewing water everywhere that happened with my last SOB 5th wheel. The flange bolts are 12 inches from the back wall. There is 1 1/2 inches between the back of the toilet to the wall. The measurement from the wall to the front of the toilet is 23 1/2 inches. In other words, looks like your measurements regarding the length of the 320 oval toilet are correct. It's really an easy change out.
2017 F-350 SRW 4x4 CrewCab
2017 Redwood 36RL with Goodyear 17.5 G114 and MorRyde IS, Disc Brakes
TireMinder TPMS monitor/Slide covers
Fusion backup monitor
PullRite Superglide 2900 Hitch