Believe it or not, there is some preparation involved before adding any rock to an aquarium. Most rocks will be absolutely fine, however it’s best to avoid any problems.
Rocks on display at an aquarium shop will always pretty much be safe. Some rocks however are for Marine tanks only. They can drastically alter the water chemistry in your tank. These rocks are sometimes noticeable however, they sometimes have a chalky kind of texture. A shop employee should advise you on this, as I nearly bought some myself.
The rocks in the above picture I simply pulled from my garden. Firstly I washed the dirt off the rocks and then give them a quick scrub with a hard bristled brush. Try not to use any cleaning products when dealing with things that are going to go inside your tank.
When it comes to taking rocks from the river, aside from legal ownership issues, some people actually boil the rock to make sure its aquarium safe. I have never boiled any rock and I don’t plan on doing so, but people have.
One thing that I do after cleaning them however, is to pour white vinegar over the rocks to make sure they don’t fizz. If they fizz it means they’re releasing some kind of gas, and that’s not good.