What are we trying to answer? If we're just asking for the odds of rolling the same number on two dice, it is in the case of 2d6, 1/6.
If we want a specific result, such as "double 1s" on 2d6, it is 1/36.
The first example, we're just looking for any double, which is a result of {1,1}, {2,2}, {3,3}, {4,4}, {5,5}, {6,6}.
The second example, we're looking for only one result out of the many combinations, {1,1} out of {n,n}.