I am communicating Arduino Nano with ESP32 with HW-Serial through MAX485 TTL to RS485 modules
All works fine in both ways with 2 wire i.e. A & B (not GND)
The distance I need to cover 20 meters only
Both modules GND are connected with microcontrollers
To be more safe, weather same 2 wires i.e. A & B are enough or i need to introduce 3rd wire for GND with it ?
Maybe. It depends. Maybe not. It will be subject to uncertainty without. See my replies in other threads on this topic. If your power supplies at both ends are 'parasitically' grounded by any mechanism, then you'll probably be okay, barring any significant noise sources between the ends. But best practices always indicate a ground would be best. Lowering your baud rate can improve things, but a ground is almost always your best bet.
More importantly, how many nodes, what terminations, where, circuit topology, will all have a huge influence on your project success.
One of the best ways to 'get into trouble' here is to connect a few nodes with just two wires, find that it works, and not know why, or whether, you have an inadvertent ground. There are myriad ways for computers and smaller systems to become grounded, including USB connections, printer connections, HDMI cable shields(though, most screens and TVs are two-prong now) etc. etc. Look for 3-pin power cables, it's one sign you've possibly got a grounded system. If your system happens to have such grounds, work well, and then have someone modify/remove one of those grounds without you knowing it, you can hunt for a long, long time before you'll find it. An example would be a USB connection to a UPS. Usually, connected all the time, for reporting. Someone moves the PC, or pulls the UPS for battery swap, and doesn't re-connect the USB; suddenly, the ground path through the USB shield to the UPS isn't there. Had "nothing to do" with your RS485 network, which you'll feverishly debug for ages.
My experience has been that it can work, but it will bite, particularly if your noise environment changes(e.g. AC unit turns on in spring, after a whole winter of flawless operation, and suddenly communication is hosed). So, YMMV.
Anyway, @awneil is technically correct, the web is chock-a-block full of examples where people don't add a ground, and either get away with it, or just didn't know they already had one. The web is full of other questionable advice.
Have a look at the Texas Instruments "AN-1057 Ten Ways to Bulletproof RS-485 Interfaces" document.
In particular page 10.
"Although the potential difference between the data-pair conductors determines the signal without officially involving ground, the bus needs a ground wire to provide a return path for induced common-mode noise and currents, such as the receivers' input current. A typical mistake is to connect two nodes with only two wires. If you do this, the system may radiate high levels of EMI, because the common-mode return current finds its way back to the source, regardless of where the loop takes it. An intentional ground provides a low-impedance path in a known location, thus reducing emissions."