Police are investigating after a school in NSW was engulfed in flames.