Yes, Android phones can send texts over WiFi. This is especially useful if you have a weak or patchy cellular signal. As long as you're connected to a strong WiFi network, you'll be able to send and receive text messages as normal.
To set up WiFi texting on your Android phone, open the Settings app and go to the 'Network & Internet' section. Select 'Mobile Network' and then toggle on the 'Enhanced 4G LTE Mode'. This will enable WiFi calling and texting on your phone.
If you're not sure whether your phone supports this feature, you can check by opening the Phone app and going to the 'Settings' menu. If there's an option for 'WiFi Calling', then your phone is compatible.
Once you've enabled WiFi calling, you'll need to connect to a WiFi network in order to start sending texts over WiFi. When you're connected, simply open up your messaging app and start typing away!