How you can archive the URL rewrite from example.com/?special=25 to example.com/special/25.

Browse the WordPress WP Rewrite class. The good examples towards the end seem like they'd get what you're attempting to achieve. Sadly not used this before so can't offer an example.

With no more context towards the question, it is a little hard to say however, in line with the URL plan that you have provided, 'special' seems to become a category, custom publish type, as well as other taxonomy.

If that is the situation, then use a custom permalink setting set to: /%postname%/ which would take proper care of it.