First, yes of course! We wouldn’t be looking at them if they were illegal! The legality of hardware clones mostly depends on if the patents for the specific console are still valid. Typically hardware patents run out in the United States after 20 years or so. This is subject to individual countries’ laws.
Some of the hardware patents on the Famicom expired in 2003, and was followed by the expiration of some NES patents in 2005.This means that NES and Famicom clones are not illegal on the grounds of patent infringement. The same is true for the Sega Genesis or the Mega Drive as it was known in Japan. With these three major consoles having expired patents, there is a rich market of clones for consumers to look into. Some offer multiple console support on one system.
It must be noted that companies like Nintendo and Sega still holds various trademarks, so another company can’t simply copy the style or design of the original consoles. That is why the looks of these clones vary so much from model to model. One thing to watch out for is if a company is selling a hardware clone with games already programmed in, this is almost always a sign that the system is not legal.
So be rest assured, that you can safely enjoy your classic games once again.