If you don't already have a toilet, there are corner-shaped toilets that you can use if you want to put one in a corner of your house. I would use one of these if you're not going to be able to put it flat against the wall. See a guide here: https://www.signaturehardware.com/lc_install-a-corner-toilet
you can put one anywhere/anyway you want as long as drain/hole in floor lines up with toilet and the water pipe(s) reach the tank
Most residential toilets do not have to be installed adjacent to a wall. It's just that is how it takes up the least amount of space. The wall does not support the toilet unless it is a fancy unit that is off the floor and mounted to the wall. That type is a cleaning persons dream come true!
Mine is at an angle. Easy to clean & you aren’t wedged against the wall