Can I use a drywall anchor in a stud to hang a shower curtain rod?
Wood screws directly into a stud are going to be many times stronger then drywall anchors.  When you have hit a stud, use a screw.  When you are just in the drywall, use a drywall anchor.

Drilling out the strong wood to replace with weak plastic doesn't make any sense.

If you really wanted to just use anchors, they make metal anchors that can be driven into a stud but the description of them is:


  No pre-drilling necessary - drills directly into drywall even if you hit a wood stud. Starts easier than other self-drilling drywall anchors.


I emphasized the word even.


(source: easyanchors.com)