As seen in the DS9 episode Prophet Motive, the Ferengi were once a much more peaceful, less greed-oriented race and have 'evolved' to become a more commercially-obsessed species. When Quark encountered the Prophets in the wormhole, there was this exchange:
PROPHET (in the form of Sisko): We examined your species' history, the
totality of your existence. We discovered that you have not always
been as you are now.
QUARK: We haven't?
PROPHET (in the form of Kira): There was a time when your peoples'
acquiring nature was not so pronounced.
QUARK: Wait a second. Are you telling me that you somehow de-evolved
the Nagus?
PROPHET (in the form of Bashir): We restored the Zek to an earlier,
less adversarial state of existence.
But, it should be noted that when 'restored' to this peaceful non-corporate state, they look exactly the same as they do today. The 'evolution' therefore may be a cultural one, rather than a physical evolution of their species.
This is a debate that still rages on today in our society - whether behavior is born into a person, or taught over time. And since we have not yet solved it today, and there is no evidence that would lead us to solving it for this series, there's no way we can know if Ferengi greed is biological, behavioral, cultural, or some combination of the three.
What we do know is that their entire culture is based around this - to the point where it is customary to give payment for entry into a person's house, and the common greeting upon welcoming someone in is "My home is my home", followed by "as are its contents", with the explicit understanding that it would otherwise invite uninhibited theft. Reference
So it seems mostly cultural, and we know for a fact that at least two Ferengi are not entirely motivated by profit. They are Nog and Rom, both relatives of Quark who is, in every other way, highly profit-motivated. Though we see evidence that Rom does still have some capitalist tendencies, even when he joins Starfleet, the two of them can and do act beyond that tendency by joining a non-corporate organization.
And we also have Leck the Eliminator from The Magnificent Ferengi, who preferred assassination over accumulation - a very unusual Ferengi.
So while there may be some biological urge for profit in a Ferengi's blood (though we don't know for sure if there is), it is entirely possible for them to overcome it, and it definitely has happened.