Bitcoin is a distributed network with no centralized server, protected by miners. Miners’ verifying the effectiveness of transactions is crucial for the whole network to function normally. In the economic system of Bitcoin, miners are encouraged to do the right thing because on condition that they produce invalid blocks, their colleagues would simply ignore these blocks and continue to work in the parent chain. Hence, those who do evil things have no any profit at all, completely a waste of time, electricity and hashrate.
Nodes will reject invalid blocks, no matter how many miners are complicit in that. Every full node in the network validates both the transaction as well as the blocks.
I've seen situations arise where people have attempted to cheat other aspects of game theory relating to Bitcoin. In the past, some have spoofed their full node client version or name to make it appear as though it is a different client. This was an, almost geopolitical, attempt to manipulate consensus, but relating to demographics instead of a physical locale.
How would the UA of the clients affect anything?
Actually, with regards of a 51% attack, it depends. A state sponsored attack doesn't care about the profits or the economics of it and the seizure of mining sites should suffice for a significant proportion of the hashrate that can be used for an attack. Whether it makes sense for them to execute an attack like this, that is specific to each individuals. Pools can execute a 51% attack as well, the profits from an attack by a rogue pool far outweighs the costs. That is why Ghash.io faced a huge controversy in the past.