It sounds like you're talking about using ADS Security Mode on your Samba server. These security modes permit Samba to offload authentication to the Active Directory (AD) domain.
The configuration process is outlined in the Samba docs. Basically, you'll configure your Samba server with the name of the AD domain, configure the Kerberos /etc/krb5.conf
file with details about the domain, and then join the domain (in a manner not unlike a domain member Windows computer).
It's unclear what you mean by "in the same network". Because the Samba server will forward authentication requests to a Domain Controller (DC), so it will be necessary for the Samba server to be able to communicate with one or more DCs. They don't have to be in the same IP subnet, but the Samba server will need reliable name resolution to be able to resolve the names of DCs.