As long as you clean them well they're fine. Make sure you do a good job of cleaning them though, as they will be quite dirty. I normally scrub them really well, then soak for a couple of days, then scrub again, rinse and put them into the tank.
You can test the rocks by putting a couple of drops of vinegar on them, if the vinegar bubbles they are not aquarium safe. To clean give them a good scrub then boil them to make sure you remove anything harmful.