If you have an Ubuntu installation media already prepared then no internet access is required to run the installer. See this Official Guide on how to do that.
Otherwise you will need internet access to download an Ubuntu ISO, write it to a disk or USB stick, and re-run the installer. Ubuntu has no Factory Reset option like, for example, Android does.
However, an answer to a similar question here suggests you can use the following command to reset the majority of settings in Ubuntu:
dconf reset -f /
Be careful, as this will do the following actions:
Running this command will reset, among other things: the apps pinned
to the Unity launcher or Ubuntu Dock ; panel applets and/or
indicators; monitor resolution and interface scaling; keyboard
shortcuts; fonts, GTK and icon theme; window button placement,
launcher behaviour; and so on.
This command will also reset any application that uses dconf to store
its settings. This includes core desktop apps like Rhythmbox, Evince,
Shotwell and Nautilus.
This latter point is important to keep in mind as this command may
reset library settings, delete accounts, disable plugins, and/or
require you to re-authenticate with online services.