Smarter people than any of us have studied dreams, and no-one is certain what they are.
Dreams, in all likelihood, reside in our subconscious mind, as the conscious mind is not operating then (which makes them possible!!)
Still, you have to “act” for there to be a sin, even if it is just consciously directing the thoughts.
There is no freedom of action in dreaming, so I’d say, no sin.
ICXC NIKA