I can't speak to the Sony phones, but for at least a couple of generations (Galaxy S6, S7, Note 5, Note 7, etc.), Samsung phones have been right there with the iPhone in terms of camera quality. The S6 beat the iPhone 6S+ by about the same DxOMark margin as the Pixel is beating the iPhone 7.
Looking at any sort of comparative review, you'll find that on some shots the Samsung produces better results; on others, an iPhone looks better. Each phone may perform a little differently in different situations -- low light, high contrast, whatever. But taken as a whole, at least some Android flagships' cameras have been as good as the iPhone's for a couple of years now.
Nexus phones have been noticeably worse, but they've also tended to cost 60% as much, so it's not exactly an easy comparison to make.