Can I quit my PHd and take my M.S OPT?

HI Guys

I have completed my M.S and I worked for 10 months in OPT (I am stem graduate) and then I joined PhD but the problems started with my new university not allowing me to rotate. I was planing to quit. In this case if I quit my PhD can I take my remaning 2 months of OPT and then apply for stem extension. Can anyone help me in this