Most Irish families wouldn't have had a formal surname until relatively recently (last 150 years), most people had a given name and then a patronymic name consisting of Mac/Nic (male/female) + their father's name.
When the British started taking censuses and asking for surnames, the man of the house would give his, and as far as the British state was concerned, British naming customs applied. Whatever name the father gave would stick as that family's name in perpetuity and be passed down instead of updating. It also wiped out the female form of the patronymic names (Nic for Mac and Ní for Ó/Uí) as in British custom daughters also get the father's exact surname.
The Ó/Uí thing historically was generally reserved for nobility who could (or wanted to) trace their lineage back to a famous ancestor, or to people who had lived in a certain area for a very long time. For example the Uí Néill traced their lineage back to Niall of the Nine Hostages and used the Ó/Uí/Ní form to show it off.