you can stain mdf, but different stain products will give different results. I find the best way to avoid any adverse affects is to use a non grain raising spray on dye. we use it to tint the substrate to either make it darker when stain is applied, or to even out the blotchiness of maple.
stay away from water based.
you are gonna wanna put several coats of lacquer or similar though.
painting mdf is a lot of work since it wicks paint like nobodies business.
I usually seal with a vinyl sealer, prime with a post catalyzed varnish and paint with a similar tinted varnish.
if you do stain your mdf, black works exceptionally well. your edges will need to be sanded very smooth. to 400ish grit. you should then apply stains with a rag, and wipe off any excess with a clean rag.