You can easily map .html pages server-side to be parsed for PHP, ASP or whatever technology you prefer. The method depends on the platform you are using, but for example if you are using Apache, you can simply add the following line to your root-level .htaccess: AddHandler application/x-httpd-php .html
It is not a good idea to do so if the majority of your .html pages are true static content, but if most of your site is dynamically-generated, it can make sense. It removes the technology identifier from your URLs and means that you can more easily alter the underlying language and keep the same URL structure. I generally use .htm everywhere even if my pages are almost always generated with PHP.
Assuming you're talking about "blah.htm?12" and "blah.htm?14" producing different pages then generally it isn't HTML that does this, it's server-side scripting like PHP or ASP which allows the dynamic creation of HTML content.
Just because a page has an .htm or .html extension doesn't mean that what you're actually looking at is actually a HTML page, a lot of the time the webserver has just been setup to make it look that way for the sake of simplicity.
There are lots of ways to learn PHP if that's the route you want to take, I'm sure the PHP forum [webmasterworld.com] here has advice on more than a few of them in its library section [webmasterworld.com].
or if you just want to get dynamic functionality in apparently static looking pages then "what encyclo said" :)