The Prophet ﷺ said: If anyone sows in other people's land without their permission, he has no right to any of the crop, but he may have what it cost him.
قَالَ رَسُولُ اللَّهِ ﷺ مَنْ زَرَعَ فِي أَرْضِ قَوْمٍ بِغَيْرِ إِذْنِهِمْ فَلَيْسَ لَهُ مِنَ الزَّرْعِ شَىْءٌ وَلَهُ نَفَقَتُهُ