Unless you were compiling from source that would make no sense. Even if you are compiling from source it makes no sense. To install software use a package manager, standard on all distros. Ubuntu defaults to Debian-style .dpkg package management and you'd normally use the aptitude command set to manage your packages. For example, if you wanted to install a webserver on your Ubuntu Distro you would more than likely start off by typing something like 'apt-get install httpd" at your command line, you would almost certainly not be typing something along the lines of './configure --prefix=/opt'!
To install software you've made yourself package up your code and then use a package manager to install it. Unless you have very specific need you would rarely, if ever, need to drop anything in /opt.