Is it possible for more than 21 million bitcoins to exist if 51% agree? One of the commonly cited advantages of bitcoin is that there's guaranteed to be only 21 million bitcoins.

However, my understanding is that the bitcoin protocol is patched by an opensource community, is it possible that the bitcoin miners could start using code that allows for more than 21m bitcoin?
Maybe. It would require a split in bitcoin users. Those who wanted the change could switch to a new version of the bitcoin software with the code changed to allow it. The problem comes from the fact that it would have to be a voluntary change. Some would want to change, others wouldn't, and this would split the bitcoin community. Any transactions that occur in the either chain wouldn't be reflected in the other. But any balance you had at the time of the split would be reflected in both chains.

It would be a matter of semantics on whether the new, modified bitcoin would even be considered the real 'bitcoin'. If the majority of the community thought it was an invalid change, then the new would take the role of just another altcoin and people probably wouldn't even call it bitcoin. If the majority liked the change, it's possible that the old bitcoin would lose value and be considered just another altcoin while the new version takes it's place (or even cease to be used at all). Or, it could be even and they could coexist, but that seems unlikely to me.

I don't think such a fork is something that the BTC developers would do to the community. Open source communities are generally afraid of forks anyway because they tend to kill projects by splitting the development team. Beyond that, doing so has the power to really lower the confidence in BTC as a currency. The people who already have coins would feel mistreated because the protocol change would mean the minimum value of their coins would be lower. It would essentially be equivalent to the gold conversion being lowered on the dollar during the gold standard.