Not for the pins connected to the matrix.
However, you can do that with other pins, but not due to the referenced code. This is possible due to other code from the UNO R3 WiFi's core variant:
My personal opinion is that one of the biggest mistakes made in the early days of Arduino was the decision to use the An format for the names of pins that happen to have ADC capability. The mistake was further compounded by choosing to mark the pins without ADC with a Dn format on the silkscreen of boards. The gives the user the false impression that pins have only one capability. Even in that era when Arduino was mostly the ATmega8, that was false, and it is far more so with the more feature rich microcontrollers (a fact which the designers should have considered even in the early days). It is silly to try to convey the capabilities of a pin in its name. The pin name should only be an arbitrary identifier.
The one mistake they avoided at that time was codifying the Dn pin names in the code. Unfortunately the developers of the "esp8266" boards platform did make that mistake, then that mistake ended up creeping into the modern official Arduino cores. However, it is not implemented in all cores, so the use of these identifiers is harmful to portability.
So all this is to say that I strongly recommend against using the Dn pin names in your code.