A former teacher from Knox Grammar School in Sydney's north has been accused of sending explicit messages to a 15-year-old girl.