That is exactly what a turbo trainer is. The most common sort is an A frame which holds the rear wheel against a resistance unit. There are 3 sorts of resistance: fan, magnetic & fluid. I recommend the mag or fluid as they are much quieter in use. The two best makes to look out for are Tacx and Elite. Try www.parker-international.co.uk if you can't get one locally. Prices start at appx £75.
You can use any sort of bike on a turbo but you will need a smooth tyre on the rear wheel.
NB - don't buy rollers, these don't support the bike so you have to balance, and speaking from personal experience it isn't as easy as it looks!
Martin.