My advice is to be aware you could have problems doing this.
Not saying you are going to have problems, but be aware they could arise if you don't have the keyboard and mouse plugged directly into the Mac.
If it works for you, well... it works.
But if at some point things don't seem to be working right, that's one of the first issues you may need to deal with to resolve the situation...