2. As shown in Figure 1, $\triangle A B C$ is an isosceles right triangle, and quadrilateral $D E F G$ is an inscribed square. $H$ is the intersection of the diagonals of the square. Then, among the triangles formed by the line segments in the figure, the number of pairs of congruent triangles is $(\quad)$.
(A) 12
(B) 13
(C) 26
(D) 30
2. C.

Let $AB=3$. In Figure 1, all triangles are isosceles right triangles, where there are 5 triangles with a hypotenuse of length 1, forming 10 pairs of congruent triangles; there are 6 triangles with a hypotenuse of length $\sqrt{2}$, forming 15 pairs of congruent triangles; there are 2 triangles with a hypotenuse of length 2, forming 1 pair of congruent triangles.
In total, 26 pairs of congruent triangles can be formed.