A WDTV Live player will play pretty much anything off an NAS or other media server. It also comes with iPlayer, YouTube and Netflix amongst other pretty random meaningless apps.
Windows Media Player can, apparently and with extra help (via a codec pack), play them. But if you can only play AVI and MP4 you need a better media player (Windows Media Player is not one of them and its apparently disappearing from Windows 10 soon).
VLC is probably the better replacement for it, little it can't play (save for Blu-Ray, apparently).
MKV is a wrapper, like AVI or MP4. It can contain any number of different audio and video codecs. To play MKVs you need something that is compatible with the MKV wrapper format AND compatible with the audio and video codec within the file. (You can easily end up with solutions that play one MKV file, but not another)
VLC is a Swiss Army Knife of a media player for PCs - and it includes MKV wrapper support and a lot of video codecs (it leverages ffmpeg internally I believe)- but it won't hardware accelerate all formats (H264 usually does well though) so you may find it judders and drops frames on high-end stuff (4K HEVC for instance)
If you are on a PC - MPC-HC is a good shout, particularly if you use it with the lavfilters which it comes with usually (LAV includes MKV wrapper support and audio and video decoders). The LAV Video decoder gives you a lot of flexibility in hardware acceleration config too.
Kodi also works brilliantly on Mac, Linux and Windows - and includes lots of hardware acceleration and built in Kodi support. It also has a great 'TV' UI. It isn't just for dodgy uses...
If you want a standalone player solution - then Kodi using LibreElec installed on a Raspberry Pi will do HD stuff up to H264 (and has zero problems with MKV wrappers). If your MKV contains H265 then look at something more like an AMLogic S905 or S905X device - but running LibreElec (which is Kodi + a cut-down Linux OS) is also a very good fit. If you like Pi-type devices then an ODroid C2 is a good fit, or otherwise there are any number of £30-40 S905X boxes (Sold as Android - but you can boot them into LibreElec from a uSD card in most cases)
Some smart TVs have built in MKV support - but beware they may not be an optimal solution. (My Sony TV runs at a fixed 60Hz when playing files back - so 50Hz stuff looks like junk on it)
Ah, I did wonder from the title. If your TV doesn't play .mkvs now, it probably never will. It's probably from the first wave of "smart" TVs which weren't all that smart.
But the good news is that if it can play MP4s, you
might
be able to remux (remultiplex) your MKVs to MP4s without having to re-encode the whole file.
This looks to be about the simplest tool for doing so:
If that doesn't work, you'll need to re-encode the whole file to something compatible with your TV (the container and the codecs used on the audio/video inside it). Everyone normally suggests Handbrake (handbrake.fr) for this sort of thing, though I've never used it myself.
I can't give you a technical explanation, but what I do to watch files off my laptop (including MKV) is use Videostream for Chrome and it seamlessly makes it appear on my telly via my Chromecast, which is plugged into the back of my telly.
(I'm sure many other products and solutions are available).
EDIT: Apologies if you were referring to a smart TV and not looking to get any extra kit. That said, I've found a Chromecast to add smarter features to a smart TV than what you get built-in with some brands, and their odd native applications.
ffmpeg is an amazingly useful command line utility for Windows, Linux and Mac OS - and there are GUIs for it too.
You can re-wrap MKV content into MP4 - and transcode audio and/or video content if the codecs used are not compatible with your TV. It really is worth learning how to use it. (The BBC have contributed some of their research into it - including a nice implementation of their previously-patented Weston 3-field deinterlacer)