Digital Current limiting with MCU
It is done sometimes (I've done it). The issue, as Indraneel has said is that it's not very fast; so for example if your load becomes a dead short, something may blow up in the microseconds it takes for the current limiter to trip.
For the purpose of preventing overloads and other conditions that can be tolerated for a short time, MCU current limiting is very useful. I think it's done fairly often.
Most practical current limiters (like circuit breakers) have 2 limits. A slow limit which will trip if a slight overload is sustained for many seconds, and a second limit which trips very fast in response to shorts and extreme overloads. This keeps things from blowing up during shorts, and also doesn't erroneously trip due to motor starts or capacitor inrush currents.
In a home circuit breaker this is literally 2 separate mechanical systems, one is a bi-metalic strip, and the other (the fast one) is magnetic.
Basically your MCU current limiter is the slow type. Depending on the application it may need to be paired with another faster limiter.
If that is all the MCU is doing, then maybe. Otherwise it is not fast enough. Even an inexpensive op amp may be found that will be faster. Besides, no buggy software to worry about (if it works once, it will work every time).
The shunt resistor and series element (bjt or mosfet) has to be there, whether you have op amp or MCU. Hooking up an op amp to that is simpler than hooking up a MCU. [And you might end up with one or two op amps anyway if the MCU has no DAC.]
The analog and digital system does not differ in whether the series element is controlled with an op amp. Both use an op amp to control the BJT/mosfet. The difference is in the way the reference input to the op amp is provided. In analog, the reference is a manual potentiometer. In digital control, it is usually a DAC. A digital pot can be used, but is hardly ever done (they are expensive, and less flexible). This DAC can be substituted with PWM and a low pass filter. Depending on the accuracy vs speed required, the low pass filter may be a simple RC filter, or an active 2nd or 4th order butterworth filter (which requires one op amp for every 2 stages).