The short answer is: yes, if it is not on an enterprise site.
I have hosted numerous servers on old desktop hardware, there is nothing wrong with this. Old computers can make excellent file, Minecraft, and web servers. However, if you are honestly asking the question “should you run a server on desktop hardware” it implies you are running something important. Don’t get me wrong, running a Minecraft server is very important, however, it is not as important as a production web server for a larger company. In that case it is better to have an actual server with redundant power supplies and hot swappable hard drives.
Another factor to seriously consider is your internet speed. When I was in seventh grade I ran an apache web server on my old computer. Since I was running on DSL, the website loaded like it was 1990. If you need high bandwidth, I would recommend you get a VPS at Digital Ocean.