Why can we use mouse-produced antibodies on mice tissues?
The reason why the secondary antibody only recognizes the primary antibody is relatively simple: It is directed against the Fc-part of the primary antibody. As this part is species specific (but constant between all antibodies from one species, hence the name constant) a secondary anti-mouse antibody is directed against all mouse antibodies.

The general principle can be seen in the figure (although this is from immunolabelling, the principle stays the same, Image from the Wikipedia): 



The anti-mouse secondary does recognize the antibodies which are present in the tissue. These are usually present at low levels (unless you work with immune tissues as spleens) and only cause a relatively low background. If it causes a problem, you can treat your sample before you add the primary with an Fc block which blocks the antibodies present in the tissue so that the secondary antibody will not recognize anymore later.