After sanding a stained surface, you may be able to paint over it using a oil based paint since most stains are also oil based. Latex paint will most likely not stick and peel off in time.
Stain is meant for raw wood it is designed to penetrate and protect the wood as well as enhance the wood grain. Therefore one cannot apply stain to a surface that is already painted. It just will not stick!