You should have no problem rotating the bowl 45 degrees. Off course, you’ll have to install new flange bolts in the new position. The problem will be that the tank will also have to rotate 45 degrees, and it will be blocked by the wall. I pressume that your current toilet is set in a corner. There are special “corner toilets” made for such an installation. In about 20 years in plumbing, I’ve installed only two of them. The rough-in dimensions for these corner toilets are not the same as for standard toilets, so it is a certainty that you will have to move the closet bend. They are easy enough to rough-in for new work, but they can be a pain in remodels. In remodels, the job will be easier if you have wide-open access from below (i.e. an unfinished basement).
Unless you happen to be exceptionally handy, this is not a DIY project.