If you want to prevent let's say people connecting through an unmanaged switch to your access port, the best thing to do is to configure port security. You can also configure the maximum number of secure MAC addresses for the port (default is 1) using switchport port-security maximum NUMBER command. Since there are no protocols running on an unmanaged switch, how can you tell there is a switch in the first place? Well, just by the fact that there are multiple/different MAC addresses communicating on a single port. Upon receival of frames with different source MAC addresses the port is put into err-disable.
If you want to prevent only managed switches (with STP running) from connecting to such port, use BPDU guard but I think that you are looking for the first solution here. Port with BPDU guard configured is put into err-disable upon receival of BPDU.
Switch(config-if)#spanning-tree bpduguard enable
If you decide to configure port-security, have a look here:
I think what you are asking is how to prevent unwanted switches being plugged into your network?
If so, the advice from Jan is the best.
BPDU Guard will only work for switches which use BPDU's and anybody technical could stop the switch sending them anyway so combine this with Port Security and limit the MAC addresses, you should be fairly well protected.
I would also advise setting all your user facing switchports to Access Ports only to prevent Trunks being formed (switchport mode access).