A NSW prosecutor has been accused of having intimate relationships with prisoners and accessing hundreds of confidential files.