You always need to be wary about claims one company makes about another's product. Microsoft waged a long black propaganda campaign against open source, and it sounds like Apple or its fans may be picking lines from their script. But both MS and Apple have too often relied on "security through obscurity", i.e. hoping that others don't know about the vulnerabilities in their systems and trusting that they won't be discovered, a model which has failed repeatedly.
The truth is that the biggest difference in security between the two is that it's much easier to sideload an app from a dodgy source on Android (the price of greater freedom in where you get apps from is that you need to consider whether you can actually trust the place that is offering the app you want), and that Apple's vetting of apps in their App Store is better than Google's vetting of content in the Play Store. However, this difference does tend to be overstated by Apple and its fans: malicious apps do still make it into the App Store, and some remain there undetected for a long time, and so iOS users still need to apply caution. And of course the majority of Android users only download apps from the Play Store, so the first difference is overstated too. But then Apple have a commercial reason for sticking to that line: they are trying to defend a monopoly on their platform, and their chosen line of defense is that if you allow iOS users to download apps from elsewhere then they will be instantly overwhelmed by malware, so really the monopoly is for their users' good...