Most rock types are safe for use in aquariums as long as they have no sharp edges, are not "suprisingly" heavy and are non-calcareous.
Sharp edges, the danger is obvious.
Overly heavy rock often contains metal ores. Some of these are harmless, but unless you know what the ores are, it is best to avoid them. If rock A feels a lot heavier then rock B which is the same size, don't use it. Metals can leach from the ores and poison the tank.
Calcareous rocks will dissolve slowly in your water, raising both the pH and hardness. This is undesirable in most freshwater setups, but ideal in marine and rift valley tanks. If a rock fizzes when you put vinegar on it, don't use it.
As always, anything introduced to the tank should be thouroughly cleaned. Any rocks which have been in a garden or similar environment where they may have been sprayed with insecticides or herbicides need particular attention.