Yes you can, but if Stealth Rock is in play then it will always damage a pokemon switching in a little bit. Every little helps! And it stays there unless you use Rapid Spin to remove it, so every time you switch another pokemon in, it will chip away at your HP.
For most pokemon it will still do 1/8 HP damage. If rock is super-effective against the pokemon it will do 1/4 HP damage, and if rock is double effective, like on a Charizard, it will get rid of half your HP straight away!!
Toxic Spikes is also great because if you lay two sets of spikes, all pokemon switching in (apart from poison) will be badly poisoned.