Place each chicken breast between 2 sheets of heavy plastic on a solid, level surface. Firmly pound with the smooth side of a meat mallet to a 1/2-inch thickness. Divide each breast into 2 even portions. Season both sides lightly with salt and pepper.
Heat olive oil in a large skillet over medium heat. Add garlic; cook and until lightly brown, about 5 minutes. Remove garlic and discard.
Cook chicken in the skillet until well browned on both sides, about 10 minutes total. Remove chicken onto a plate and coat with pesto. Cover the plate with plastic wrap and refrigerate for 15 minutes or up to 24 hours.
Preheat oven to 375 degrees F (190 degrees C).
Unfold pastry sheet onto a lightly floured surface. Roll into a 14-inch square and cut into four 7-inch squares. Sprinkle an equal portion of mozzarella and Parmesan cheeses over each square; place a piece of chicken on top.
Whisk egg and water together in a bowl; brush mixture over the edges of the pastry squares. Fold corners of the pastry over the chicken to the center and press to seal. Place filled pastries seam-side down onto a baking sheet. Brush with the egg mixture.
Bake in the preheated oven until golden brown, about 25 minutes. Let cool on the baking sheet for 10 minutes.