A veteran Naperville police officer shot and killed a man who attacked him with a hatchet during a traffic stop Friday morning, police said.