A prison guard is under investigation amid allegations he had sex with an inmate’s wife on or near the grounds of the Townsville Correctional Centre Farm.