Can I have an iTunes library on a hard drive connected only to my wi-fi router?
Yes, you can store your iTunes library on shared drive. Its not really any different than an external drive attached via USB or the like.

Apple KB: iTunes for Mac: Moving your iTunes Media folder

If you are looking to run home sharing, or stream to an AppleTV or the like you still need a computer to handle that.