Ubuntu offers convenient means to compile a package on your own machine. However, there is no way to check that the executable in a binary package that you downloaded has been obtained from that source code. The signing process used by Ubuntu reduces the risk of third-party tampering with the packages substantially, but you still have to trust that no harmful code has been added before the compilation that is not reflected in the downloadable source code.
The reason is that it is tremendously hard to obtain precisely the same binaries as there are in the compiled packages, as these depend on the precise compiler version, its options, and probably there are also some paths or environment variables compiled into the binary. So you will be unable to obtain precisely the same binary when compiling yourself, which would "verify" the downloaded binary.
There is actually a small research community around precisely this problem - how to make compilation reproducible.
Having said that, a manual comparison of a downloaded binary and a self-compiled one can detect added/modified code, so it would be risky for someone offering binaries and the source code to hide something in the binaries, as this can be detected.
But then there is also the problem of trusting the compiler, as already mentioned...
apt-get source
, or use that to compile your own. See this question: askubuntu.com/questions/28372/…