Connect arduino nano and ESP32 with I2C on the GPIO7 and GPIO8?
Since I made a PCB prototype, I would avoid to add some wires and cut the traces, so I would ask if I could use these pins (GPIO7 and GPIO8) as SDA and SCL.


No, you can't. Those pins are used by the internal flash chip. If you connect things to them you will end up not being able to read the flash and thus won't be able to run any code.  In other words, the chip will not boot. So you will have to bite the bullet and cut traces and add bodge wires.


  Wire.begin (7,8)?


Yes. That will control the bus matrix to route the I2C through different pins - but of course you can't use those pins, as noted above.


  On the arduino side I wrote:
  
  digitalWrite(SDA, 0); digitalWrite(SCL, 0);
  
  It is correct to do the same thing on the ESP32 side?


No. That exploits a quirk in the AVR GPIO system that doesn't exist in the ESP32. In the ESP32 the pins are configured with:

pinMode(sda, OPEN_DRAIN | PULLUP | INPUT | OUTPUT );


and

pinMode(scl, INPUT | PULLUP);


so you could try replicating that in your code but without the PULLUP flag. However the effect of this is unknown, so YMMV.

However, if your external pullups are pulling up to 3.3V then you really don't need to do anything on the ESP32. All you end up with is a large resistance in parallel with your 4.7kΩ, which will just cause your resistance to drop slightly (and since 4.7kΩ is arguably too high any way that's a good thing).