You still can, but its performance will be dog-slow at PC/web/server tasks compared to an Intel NUC off the used market.
That's why most people who bough those RPis had them collecting dust after a few weeks since you can blink LEDs with an 5$ Arduino/ESP32 too.
At the time the RPi came out I don't believe Wi-Fi-enabled microcontrollers were a thing or were as widespread. RPi was the OG low-cost, popular Wi-Fi "microcontroller".
You are right that nowadays a lot of that can easily be done on an ESP32.
Im about to deploy pis in locations that use dumb 1200$ PLCs and esoteric ladder programs requiring technicians who know nothing about the logic of the system.
With Pi, we eradicate that artifice and allow self service and ease of upgrades.