I once had an accident with permanent marker on a curtain.
I put a thick pad of cotton wool behind the stain and dabbed the stain itself with cotton wool dipped in surgical spirit.
I then washed the curtain as normal.
If you try this method, test first on a bit not normally visible to make sure you're not going to be left with a worse patch, as it may lift the dye out the material