I've done it, but only for craft projects that wouldn't be getting washed. Over time, the stain will fade. You'll need something to "set" the stain/dye. You can buy something commercially (I forget what it's called) or you can use salt.
Years ago I did a project on spinning & dyeing for an education course I took. I hadn't planned on washing the items - just keep them around to use for classes I was teaching. I used salt because it was cheap. After a couple years of just sitting in a box, unexposed to light, the colors had faded quite a bit. I don't know whether I just didn't use enough or what.
Deb