Yes thats what its for. I personally just soak my rocks in a bucket of salt water for a day or two. Use a strong brine solution with sea salt sold for fresh water aquariums.
boiling water kills germs and bacteria, i used aquarium salt and let em soak n then after soaking i boiled em down. the last thing u want is an infected new setup
While boiling rocks is a precaution that kills bacteria and helps to loosen stubborn bits of dirt, it will not remove chemical contamination.
The safest thing to do about that is to pass up any rocks that might have picked up any kind of industrial pollution. This means don't use rocks that you find on the side of the road, in a parking lot, or in any urban area. I will usually take a chance on ones that have recently been unearthed by construction work, etc.