Security is just an illusion. If you know what you are doing then perhaps you are safe. And, that is possible even when using any Operating System. For instance, If you are looking for an image editing application on Internet. Eventually, you will find one and install it. But wait, did you ask yourself if the application was downloaded from trusted sources. Was the source code available to user for inspection. If the answer to both the questions is NO then, you can't ever be sure if it was right to install that particular application.
One argument against the second question is - not everyone is technologically proficient to analyze application code. That is correct, but if the application source code was available for all to inspect then someone could have spotted a potential vulnerability thereby making that organization to fix those vulnerabilities.
Are Ubuntu/Linux Distributions considered relatively secure?
Firstly, When you plan on to install an application software then first place you need to look in is Ubuntu's package manager. There are repositories available containing trusted application software. So, you can be rest assured that you are installing the package from a trusted source.
Secondly, Ubuntu/Linux users are never logged in as root user unless specified. A root user has the privileges to modify anything on the distribution. To have root's privileges, one needs to directly login as root or a user who has been assigned super user privileges. And, without the superusers' access it is impossible to make any changes to the critical files of the Ubuntu/Linux distribution. Above all, Ubuntu/Linux users have Apparmor/Security Enhanced Linux to assist them in critical moments.
Lastly, Its free and open-source; any one can analyse the source code. Potential vulnerabilities can be spotted and fixed quickly. Developers, with the best of intentions, develop applications that they consider secure. Despite that there could have been loopholes that may have been overlooked inadvertently. Under such circumstances, other may chip in and assist in keeping the application secure. That itself results in an efficient outcome. Compare this to a scenario, where only ten developers designed an application and they remain unaware of a potential vulnerability for the longest of time. Someone with malicious intentions may exploit the vulnerability for years without getting spotted. In that scenario, imagine the damage/loss incurred.
Choosing between an open-source and closed-source distribution is tough task. We can never say one is more secure than its counterparts. Both the Operating system types has its pros and cons. What if the closed-source distributions start providing applications through trusted sources or start building one of its own like many already do now, or a team of dedicated individuals is consistently monitoring the software application for potential vulnerabilities. That brings us to the question that we asked initially which operating system is secure - The answer can be either all of them or none.