Set Parameters from User Input
Yes, you can pass in a variable into the parameters and to get the query string values use craft.request.getQuery().

I can recommend this blog post by Jérôme Coupé for a great introduction to setting up the form and the criteria model filters:

Combined searches and filters using Craft

You should also have a look at other questions tagged with "form".