The simple answer is: Yes, you can of course change a derailleur.
I must take a guess but it looks like a fairly modern Shimano Tourney RD-TY300-SGS* which should be an easy to get part, if you can source parts at all. It is in the range of 15-20$ as a replacement part, but you'd probably need a bike mechanic unless you are confident of swapping and adjusting the RD.
*) "Fairly modern" because disc brakes are shown, RD-TY300 is the cheapest model and the SGS variant should enough to accommodate the cassette shown
However, despite it being impossible to judge from the picture what is broken respectively not working anymore, to me it doesn't look as damaged that you have to replace it in an instance.
Your bike being stolen and then dumped by the road makes it more likely that it just fell on the derailleur and (most likely) the derailleur/derailleur hanger is bent or rough handling messed with the cable (tension), so that poor or even no shifting is the result.
You probably need to come up with more details on its misfunction to get better help, but you might check related threads such as
I hope that helps as a starting point.
Update
Base on your description
The derailleur looks ok, but it comes off the bike, there's some sort of internal washer that holds it on, it also keeps it in a certain position, so without it, the derailleur doesn't work [...]
and the marking on the picture above, I think the B-tension assembly is damaged, perhaps the spring is broken or some nose snapped off, hard to judge.