No. You cannot sin in a dream. However, since some think that dreams may be in some sense a reflection of our subconscious or of what we were doing prior to sleep, if recurrent troublesome dreams are a problem, you may want to examine those areas of your life that could be contributing to the bad dream. For example, if you often have “impure dreams,” you may want to examine whether your reading or viewing habits (particularly those right before bedtime) could be contributing to such dreams and change such habits accordingly.