Really, the only acceptable use of the server components on a desktop Operating Systems (IIS for example) is for development purposes, in my opinion. As for the legality, my stock response of Ask Microsoft applies.
There is a concurrent connection limit in client versions of Windows (10 I think) which don't exist in the server versions. That means if you have a "file server" running Windows 7, only 10 people will be able to simultaneously access it.
There's more to a server than the Operating System it runs. I assume if you're planning on running a client version of Windows, it'll go on a regular PC. These aren't designed as servers, and as such have no redundant components. Additionally, some applications check the version of the Operating System they are running on and refuse to install.
In short, don't do it - you'll end up regretting it when it all goes up the swanny.