Yes, you would use the Samba global variable "hosts allow".
This can be be used to list acceptable hosts, like:
hosts allow = 192.168.1.1 192.168.1.2
Or give a range of IPs:
hosts allow = 192.168.1.
There is also "hosts deny", which is the exact opposite. There you name hosts or networks that are not allowed to access the server.
If your machine has two interfaces (one on the LAN, one on the Internet) then you may also want to look into binding Samba to only a single interface. For example, to bind Samba to localhost and eth0, you would add the following lines to smb.conf:
interfaces = lo eth0
bind interfaces only = yes