Samsung devices can configure the APN (Access Point Name) settings automatically depending on the SIM card. You may see a pop-up message during Setup wizard in the first boot up the SIM card was freshly inserted on the device and the APN is not set yet.
If the incorrect network or wrong APN settings is set, you will not be able to use internet through the data network and so on.
Samsung sets the provider's APN on it's software so if the internet does not work upon setting up the APN from the configuration message of the service provider, then you can still reset it with the default one set and tested by Samsung.
To reset, first go to Connection settings.