It’s possible but unlikely. Dreams are personal; they’re individualized, meaning each person has their own reason for dreaming what they do. The only way to know for sure is to ask your ex, which I would strongly advise against. Instead, believe the positive possibility that they are dreaming of you.