Formality theorem and Kontsevich-Duflo theorem for Lie pairs