The statement that one cannot sin in dreams is not made directly. However Eccl. 5:7 says that many dreams are composed of sheer vanity (emptiness) and presents looning to them as the opposite of fearing God. Is. 29:8 tells us that many dreams have no substance, and that what is in them is not real. The only other type of dream mentioned, is that sent by God. If Scripture can be used to infer that there are no other types of dreams (which is a leap of logic, but some believe God's word is thorough on anything that matters for our needs), then, it is clear, one cannot sin in a dream given by God, because God does not sin not tempt; and one cannot sin in a dream which is not real, since if there is no real action or choice, there is no sin.