You need a bulk file renamer. It could replace the text string "mkv" with the text string "avi" for all files in a folder or group of subfolders. Or instead, you could ask it to remove the last 3 characters of the name and replace them with "avi".
I use NameItYourWay and it works very well, but I'm not sure it is easily found on the Internet anymore. However, there are other similar programs out there that work the same way.
Once you understand it, you could rename a thousand files in a minute.