Very easily
On a long enough timeline, what you describe is inevitable.
- Precondition: the political system is not adequately protected against corruption
Safeguards against corruption come in many forms. Indeed, a society must institute multiple overlapping safeguards if it is to have any hope of avoiding rule by organized crime.
One reason countries don't do this is because politicians benefit directly from many kinds of corruption1, and countries generally depend on those same politicians to write the rules that would keep them honest. Unsurprisingly, these politicians "fail" to write and enforce rules that would take away their own opportunities for personal enrichment.
1 Political corruption benefits individual politicians until the corruption is so widespread that the people doing the corrupting acquire control over significant parts of the economy or government. From that point forward, political corruption stops being an opportunity for gain, becoming instead a skill that is necessary simply to avoid poverty, imprisonment, or death.
- Assumption: criminals become wealthy
One of the primary reasons people commit crimes is precisely to gain wealth they might not gain otherwise. Nobody cheats to get into last place. This is not to say that most criminals become rich -- they don't. Rather, crime is appealing as an alternative path to success, a path which becomes more appealing when there are few legal paths to success, such as when legal paths have been deliberately closed by people who are already wealthy.
- Assumption: economic power translates into political power
If you have or control enough wealth, you can use that wealth to manipulate the political system. This is light-years beyond simple bribery, which is usually cartoonishly depicted as a criminal secretly giving a politician a sack full of cash.
Here's an example: you are the CEO of a giant company, and you learn that some lawmakers are going to create a new law that would interfere with some of your favorite money-making schemes. So, you identify a couple lawmakers who are trying to make that happen, and you let them know that if they do this, you will relocate some of your businesses out of their districts, which will lead to an economic downturn in that area, which residents will blame the lawmaker for (and you can help make sure they do assign that blame). This is not a bribe, it's a threat. And there are a million ways to deliver that threat which prevent it being exposed as extortion.
Things are made infinitely worse when having lots of money becomes a prerequisite for becoming a lawmaker in the first place, as is the case in every country that allows political campaigns to raise and spend as much money as they like to win election.
If those conditions persist long enough, you'll reach a point where a significant amount of economic power is in the hands of people who have decided that government is merely an impediment to them being even richer, an impediment they want to remove.
These people will have something in common with organized crime: they want to see government smaller and weaker so it can't interfere with their private plans of getting rich(er).
The rich folks will pursue a few different strategies simultaneously:
- they will try to convince non-rich people to dislike and distrust government
- they will try to invent some kind of theory or political philosophy that justifies making government weak
- without eliminating property rights, since acquiring personal property is their entire goal
- while strengthening contract law, since contracts are one of the primary tools used by rich people to acquire manpower (from the non-rich) for their activities
- they will cultivate like-minded people with the goal of inserting them into government, because government is after all just made up of people and rules, and if those people are all working in concert to help you get rich and stay rich, then you'll find that government no longer interferes with your hoarding of wealth ("people are policy," as the saying goes)
The rich people who are not criminals will be working to weaken government because a weak government will be unable to punish them for "victimless" crimes like tax evasion and predatory business practices.
The organized-crime types will welcome this because it takes a lot of resources to detect and prosecute organized crime syndicates that are competent, and a weak government won't be able to do that.
Eventually the only people with economic or political power will be law-abiding rich people and rich organized crime figures. This is when the organized crime figures can take advantage of the fact that law-abiding rich people have been relying on stuff like social norms and laws to protect them from people who want what they have -- but that stuff only has power if the people in the situation choose to adhere to it. So the organized crime figures will then use force to seize their fortunes.
Finally: one enormous benefit of taking over the government is that this allows you to change the laws so that your previous crimes can't be punished and the crimes you're planning to commit in the future are no longer considered crimes. An especially audacious criminal might even pardon himself while in office for high crimes he committed in that office in an attempt to keep the office.
--
See also: Michels' "iron law of oligarchy".