Yes, the Android TV boxes (really more like a dongle than a box) are not illegal, and never are likely to be illegal. They are basically a stripped down version of Android (the cell phone/tablet operating system) running on a small computing device that is optimised for TV (video processing). Another way of looking at the device would be a more "open source" version of the ChromeCast where you get to choose what software you load. We own one (both Android TV and ChromeCast actually) and use them regularly. There is nothing illegal about the device itself, just as there is nothing illegal about owning a computer, but you can do illegal things with the device.
What can become illegal (not criminally, generally copyright infringement which is more of a civil offence) is what software you load onto it and what content you access from it. These devices run Netflix, and if you have an account you are totally on the up-and-up. There are other software/services that charge for the material you access that are legal. Watching YouTube videos is generally legal (since infringing material is pulled down pretty quickly). Where you start to infringe and cross the line is loading applications that stream privately recorded current TV or movie content from public (generally offshore) servers. The reason the quality is lousy is because folks are recording off air at home and posting online without any respect to copyright law.
So, it can be a great adjunct to your cable provider (I have an extremely limited package of local channels only from my cable provider), and used judiciously and properly is totally above board. But if you choose to stream content that is effectively pirated (the producer and artists receive no compensation), then you are liable for related fines and penalties. The folks who sell these devices are very circumspect about how they present this, but a close reading of their terms will show they absolve themselves of all responsibility for what you choose to download and view. There is little prosecution of this in Canada at this time, but with the advent of the "Notice and Notice" legislation, that is starting to change. It really comes down to a morality question, and like speeding in your car, a consideration of "don't do the crime if you can't pay that fine".