All of the software on the Ubuntu Software Center is safe and is maintained / verified, reviewed / developed by known developers (either from Debian or Ubuntu) and that's the reason it is in the Ubuntu repositories.
More risky business is when installing applications from third-party sources which is done by adding the Personal Package Archive (PPA) to your system. After a PPA is added it is trusted by the system and any updated software from that PPA will be updated automatically. Well, if some developer goes rogue and makes a malicious software then that application will come in as an update, if the particular PPA was added. Hence, adding PPAs should be done cautiously.
Read more in the following excellent links.
- Which Ubuntu repositories are totally safe and free from malware?
- Are PPA's safe to add to my system and what are some "red flags" to watch out for?
- Is there any guarantee that software from Launchpad PPAs is free from viruses and backdoor threats?
Case where the user compiles and installs using
Generally some libraries, custom compilers and customized applications which are system build and parameter dependent (need configure) are installed that way. Hence, usually these softwares come from known developers, researchers, scientists, companies, GNU developers, etc...
However, exercise caution and use your experience while building softwares from source. Don't just blindly build any piece of code !