Not sure it can be done with Pivot tables

You could put this into Column C copied down or something similar in a table with known combinations

=COUNTIFS($A$1:$A$10,A1, $B$1:$B$10,B1)+COUNTIFS($A$1:$A$10,B1, $B$1:$B$10,A1)