In case of Ubuntu you can install a program from a .deb file. To install a package use in terminal,
sudo dpkg -i /path/to/<package>.deb
You can download, store, distribute the .deb files. But to install a program from a .deb file you need to have all its dependencies also. The dependencies are available in the form of .deb files.
How to get the .deb files
You can go to packages.ubuntu.com search for desired package and download them. Don't forget to choose correct distribution and architecture before you download. There you can find all the dependencies for a particular package. You need to download them if needed (if not installed already).
To check a package is installed on your system, type in terminal,
apt-cache policy <package_name>
When a package and its dependencies are in your hand you need to install the dependencies before you install the main package.
How to get .deb files from your own system source
When you install a program with apt or Software center the .deb files along with its dependencies automatically stored in /var/cache/apt/archives. You can have the deb files from there also.
Sometimes the files get deleted by user or somehow. You can download all the packages that are already installed again using this command below,
dpkg -l | grep "^ii"| awk ' {print $2} ' | xargs sudo apt-get -y install --reinstall --download-only
To re-download a particular package use,
sudo apt-get -y install --reinstall --download-only <package_name>