Before you reapply or apply in another country, you need to find out why they canceled it so that you don't make the same mistake again, if it was a mistake.
I once had a problem with not canceling my ED visa and then wanted to fly back home. At the Bangkok airport, the female customs officer completely freaked out and started yelling at me. She then disappeared into the backroom and came back, cursing and screaming. The whole thing lasted about 20 minutes, and in the end, she somehow canceled my visa. As you can imagine, I won't forget this. I can't say whether a non-cancelled ED visa will affect your DTV application, but as a precaution, I properly canceled my ED visa before applying for my DTV visa. I think that's the proper process.
Cancel your travel plans and stay in Pakistan until you receive your visa. When you enter Thailand, you must complete the TDAC, which may be viewed by the consulate officials. They will then know that you are no longer in Pakistan but in Thailand, and this could cause problems. In the worst case, they might even reject your visa application
Go to your school and ask for the cancellation documents for your ED visa. Then go to your local immigration office and properly cancel your ED visa on the date you leave. After that, you can apply for the DTV visa outside of Thailand.