Emulation of the WiiU on the NX would be relatively trivial as the Wii U's hardware is relatively poor.
The PC emulates things far differently than how the Xbox One does emulation, the PC will "Brute force" it's way through as it will take an instruction, translate it and often chop it into several other instructions to be executed on the host machine, which is why it requires orders-of-magnitude greater levels of hardware.
What Microsoft has done on the Xbox One is virtualised the Xbox 360's OS, created an API between the Xbox One's hardware and the VM layer and then repackaged the games, it has stupidly low overheads and fantastic accuracy, impossible to do on the PC without intimate knowledge of the hardware.
Before the Xbox One's release, people laughed at me on these forums when I said emulation was entirely possible on next gen and they pointed towards PS2 emulation as the example of the hardware required to achieve it, even after I provided a detailed analysis that says otherwise. (Obviously I got the last laugh, when Microsoft announced it. Suckers.)
The PS3 could also be emulated on the PS4.
But that is a Software approach.
If Nintendo opts for the Hardware method... Then all they will need is probably the CPU.
And if we shrink the CPU from 45nm down to a MODERN 14nm included in the SoC, then you are looking at an insignificant cost, we are probably talking cents here as the Wii U's CPU is only 50~ to 150~ Million transisters.
The Xbox One and Playstation 4 have 5~ Billion transister SoC's, with roughly 400-500 million transisters for the CPU units, the Nintendo NX could even be larger than that.
9~ Billion 28nm chips are available, 14nm would allow you to bring a 9~ Billion transister chip down to the size similar (Or smaller, depending on other factors) to that of the Xbox One or Playstation 4's SoC.
Essentially, allowing for hardware backwards compatability wouldn't be terribly expensive, the Wii U is built on an old node and was pretty conservative with it's transistor counts.
With that said... If I was in Nintendo's position, I wouldn't bother with backwards compatability with the Wii U at all.
The Wii U does not have a large games library or fanatical user base, they would be better off providing regular Wii comptability.
I don't even think what the Xbox One is doing is pure emulation to achieve backwards compatibility. I suspect that their straight up modifying binaries to achieve backwards compatibility since they need permission to change the source code ...
That been said I think Nintendo could emulate the WII U if the CPU has comparable IPC to sandy bridge at moderate clocks ? Emulating the GPU is easier than I thought it would be since Cemu is getting by just fine with OpenGL 4 compared to other 7th gen emulators needing DX12/Vulkan but I guess Nintendo doesn't mess around a whole lot on a lower level compared to MS and Sony obsessing over a lot of the intricate details ...
They are doing a bit of both. They *are* emulating the Xbox 360, just not in the traditional PC brute-force sense.
But they are also modifying the games, the extent of which I would be interested in knowing, it is nothing massive like porting the games to different game engines that another poster here thinks they are doing, but it is also significant enough that you need to download the game even if you use a disc.
Still, the point is, the same method could be employed on the NX or the PS3 on the PS4.