The first theory is more obvious for Irish speakers because the word 'ó' literally means 'from'. So it makes complete sense that Ó Néill would mean 'from' Niall for 'descendent of Niall (of the nine hostages)'. For the modern Irish speaker the second theory is a lot less transparent. To say 'Grandson of Niall' one would say 'Garmhac Néill' so it is not obvious at all how it could be translated as Ó Néill. However when we look to Old Irish we quickly find the explanation. The old Irish Úa means 'grandson' or descendent.
The initial question we posed, 'what is the literal translation of 'Ó' in an Irish surname?' can be answered confidently as 'grandson of/ descendent', and not literally 'from' in the sense of descendent. This is because from is a preposition and is not declined in any way; it always appears in the same form 'ó'. The 'ó' stemming from 'grandson of', however is declined exactly as the 'Ó' which we find in surnames. So more than one Ó Néill are pluralised as Uí Néíll. Similarly 'Ó Niall's house' (utilising the genetive singular) would also assume Uí Néill - teach Úi Néill.
What makes the declining of this particular word particularly clear is, apart from the fact that this word is used in Old Irish literature, that it is cognate with the latin word 'avus' and similar words in many Indo-European languages all stemming from the Proto Indo-European word *h₂éwh₂os. The earliest known form of the Irish word, 'avi' is immediately similar to the latin 'avus' at a glance. The problem is that the latin avus means grandfather, not grandson. Furthermore it appears that all the other derivatives of *h₂éwh₂os mean grandfather and not grandson.
To be continued...
..