I got a D in math 1. I needed at least a C to register for math 2. The school computer registration system doesn't allow me to register for class 2. If I register for math 1 a semester prior I can register for math 2. What I did was registered for math 1 in summer and math 2 in fall. Then I dropped the math 1 class but the system still says I am registered for math 2. Can the school drop the class without my consent? The tuition is already set so if I pay for the tuition can they un-register me?
So ... if I understand your post correctly, you found a flaw in the system that allowed you to register for Math 2 even though you got a D in Math 1 and were ineligible to register for Math 2.
If the school catches the error (which they probably will but might not), yes, they can cancel your registration in the class. You did not meet the qualifications.
Why don't you just re-take Math 1 this summer so that you can get better than a D the second time around, so you are eligible to take Math 2 in the fall?
edit: I am really slow in posting - I agree with justalayman and Silverplum asks a good question - are you in the US?