Can someone thinking about you make you have a dream about them?

Okay so I don't want to sound stupid haha but on another post someone said that if this girl had a dream about her ex that means he was thinking about her. Can that actually happen? I don't see how it's possible but it would be interesting if it was