Heat oil in a nonstick skillet over medium-high heat. Add tomatoes, capers, and pepper flakes; sauté until just starting to break down, about 3 minutes.
Off heat, add vinegar.
Brush oil on one side of each slice of bread; spread the other sides with 1 tablespoon pesto. Arrange mozzarella and tomato mixture on two slices of bread, then sprinkle with salt and pepper. Top with another slice of bread, oiled side up.