It is difficult to clearly say whether epoxy will adhere to wood that has been stained. Not all wood stains are created equal. Some are designed for a proprietary wood finish system, and are not compatible with other systems. Some have other additives to make them multi-purpose products, such as weatherproofing.
Under most circumstances, epoxy will form a great bond to compatible substrates that are clean, dry surfaces free of contaminants. The epoxy should have no issues with curing unless a foreign chemical or substance hinders the reaction.
If there is ever a question as to whether epoxy will apply properly over a stained surface, it is highly recommended to make a sample to test for adhesion and verify that the epoxy cures to the desired finish.
It is very important to follow the instructions on the stain thoroughly, and then follow the epoxy's instructions. The stain must be dry, and any of the solvent or liquid must have evaporated. Make sure that any extra stain that is just sitting on the surface and is not contributing to the appearance has been removed with a rag before applying epoxy.