AppGet is open source, under the Apache 2.0 license: https://github.com/appget/appget. That means basing a new project off AppGet - including using its source code - is legally permissible.

edit: This is explicitly not a judgement of ethics.

Forking is permissible, but you still have to adhere to the terms of the Apache License 2.0. You can't remove copyright notices, you must provide attribution, if you release source you must indicate what you changed, etc.

That Microsoft didn't do any of that indicates that they do not believe that WinGet is a derivative work of AppGet under copyright law, so the copyright license granted by the Apache License is not needed.

ETA: That is, Microsoft believes they don't need a copyright license. My personal position is that I would have liked to see a proper fork under the ALv2 with attribution, which would have avoided all this mess.

WinGet is open source under the MIT License, which I believe keeps them in the clear: https://github.com/microsoft/winget-cli. In practice, I've never heard of any legal problems when a derivative project is also open source under a similar license. (Yes, the licenses are different. But I also believe they are considerable compatible.)