Is it illegal to hire a private investigator? The straight answer to that question is NO, it’s not illegal.
You or anyone can hire a private investigator and it's as legal as you would hire a car mechanic.
But the question regarding legalities raises other questions that need to be addressed. The questions are not so much about the legal hiring of a private investigator in itself, but the activities that are undertaken once you have hired one.
Yes, it is legal to hire a private investigator, but why you want to hire one and how the investigation is conducted will decide whether or not there are illegalities involved.