Primary Consideration
Due to the controversial nature that this specific problem represents, it takes a mature player and a mature DM to handle this specific scenario well. Ensure that the player and DM have a conversation about something of the magnitude of power revocation BEFORE it is implemented in play...
If you are the DM and this is established as part of your world, ensure that players know this up front if they are considering playing a warlock (or any other class likely to have powers revoked for any reason).
If you are a player and you want this to either be highly probable, talk with your DM. It can create an intriguing story.
Already covered
RAW, there isn't any explicit text that covers a warlock's powers being stripped. Also, there is no class that has rules text covering a loss of powers, save the Paladin whose powers change form when he becomes an Oathbreaker. (DMG p. 97)
Lore from stories associated with various pact-style magic demonstrates and sets precedent that it could be a good story hook, allowing for a very interesting story line that leads to all the things that were mentioned in the original question.
Also Consider
The power belongs to the entity to dole out. If they granted it, it is likely true that they could take it away. This is more of a reference to old literature, to what makes sense, and to what would be fun with the game you and your DM seem to be trying to build.
The rules do not state the specific pact, this is the part that cannot be stressed enough. The power that they currently have should mostly be considered as payment for services rendered. If they are not completely paid for (ongoing payment, for example), then try to avoid stripping a lot of their power from them. Make it minimal, but noticeable. Lower spell slot levels by one levels as that part hasn't been paid in full, if that helps the story line, but do not completely cripple the character.
As for the specific scenario posted in the question:
The devil is highly unlikely to strip power from someone if it is part of a contract. To do so is highly unorthodox for a devil, and would be looked at even more poorly than an upstart servant that the devil couldn't control. The devils live by their contracts, and although adding loop-holes may be favored, rescinding an agreement is not. If a devil were to rescind the power of one of their warlocks, it is likely that another entity would try to mock them by taking the contract instead. This is even more true of a relatively powerful warlock. That said, a devil is also very likely to add a hidden clause that prevents the warlock from using their powers against the devil, with revocation of powers being either temporary or permanent, depending on the devil, the warlock, and the devil's disposition at the time.
They will follow the letter of the contract completely, but don't care about the spirit of the contract. If the devil is powerful enough to grant powers as a patron, they are likely intelligent enough to be more careful about the contract, though a particularly savvy and/or intelligent character could manipulate them in to a contract that is written to the benefit of the character more than the patron (protecting themselves from abandoning the patron, for example).
If you really want to do it
The best way to add the possibility of power revocation for story-line purposes is to ensure that it is an active part of the party's story (as opposed to a passive one). Allow the party to try to stop the powers from getting revoked, or have another patron (possibly a more sinister one) inform the warlock that they are going to lose their powers and offer to be a surrogate patron.
Do something that directly involves the warlock in whether they lose or retain their powers.
In short
Is it possible? Rules don't state that it is, but this is something a DM could easily say yes to with good justification to back it up based on game world.
Should the DM take this path? Probably not, or at least not seriously. If he does, then he should offer a work-around. Don't strip power from a character/player without offering a way of obtaining it again. Don't make the game less fun.
Getting the Demon Spirit Out
The rules don't really specify what happens when a demonic spirit is exorcised, so we're going to be using the assumption that the spirit is still around once it leaves the body. If you rule differently, you won't need the latter half of this answer.
Dispel Evil and Good explicitly mentions ending possession of a creature. This will probably be the easiest way to get the demon out.
Break Enchantment: As your action, you touch a creature you can reach that is charmed, frightened, or possessed by a celestial, an elemental, a fey, a fiend, or an undead. The creature you touch is no longer charmed, frightened, or possessed by such creatures. (PHB, 233-234)
What is told about demonic possession from the Monster Manual is that demons can possess creatures when their essence emerges from the container that holds it, which implies the demon was bound to an object. Essence here implies more of a spirit or soul, rather than tangible body. You can read about binding demons and possession in the Monster Manual, page 51, under the headers Bound Demons and Demonic Possession. This also suggests that demons can't normally possess other creatures if they have their own tangible body. There's nothing to suggest their spirit can move from body to body willingly, but there's nothing suggesting they can't possess another creature after their spirit has forcefully been removed from the previous host either.
What this likely means is that exercising the demon will probably result in it attempting to possess another creature.
You have two options:
Sending the Demon Spirit Back to the Abyss
With this option, you're looking to send the demon spirit away. If the DM allows it, the spirit should be able to be targeted by spells. There's no real rules for a spirit, so you'll need to decide if this is possible. If it is you can use a simple spell like Banishment to send the spirit back. Another, more complicated way is to cast True Resurrection on the spirit (you'll need to know his true name) and then fight its new body to send it back. You may also use that as a bargaining chip, to perhaps make a deal with the demon, if that is even possible.
You might also be able to remove the demon by finding an amulet it has put part of its essence into. Destroying the amulet will trap the demon in the Abyss for a year and a day (MM, pg 51, Protected Essence). This would probably end possession and send it back all in one go, depending on how you rule it.
Binding the Spirit to an Object
You also have the option to bind the Demon to an object, which is likely how it came to possess something in the first place.
The Monster Manual suggests that The Book of Vile Darkness, the Black Scrolls of Ahm, and the Demonomicon of Iggwilv are the foremost authorities on this subject. The Book of Vile Darkness is detailed in the Dungeon Master's Guide on page 222, in the Artifacts section. Suffice it to say that binding the demonic essence or sending it back to the Abyss is something you're going to have to use your DM powers for. Keep in mind you'll most likely need an evil character to use the book. The Book of Exalted Deeds is basically the polar opposite of this and might also help, altough it doesn't detail any control over fiends and the like, but it does help you fight them and can even destroy an evil creature that tries to read it (if a demon, this would likely send it back to the Abyss).
Either Way...
It would be smart to cast Protection from Evil and Good on your party and any participants in the exorcism, as it protects you from possession. It can also be used to exorcise the demon from the host, but only if there is a relevant save (there isn't one listed for demonic possession).
I'd also suggest a good reason for the possession. The MM suggests that demons that escape their bindings seek revenge on the one who bound them, which could be the noble or someone close to him, depending on how powerful the demon is. Greater demons are usually smarter than lesser demons - I mean that to say that a greater demon would likely plot and scheme through possession, where a lesser demon would likely just rage around and create chaos.
Best Answer
A warlock can become a patron, but there are no specific rules for it
According to Dungeon Master's Guide p.38, becoming a patron is indeed a possibility for a warlock who reaches 20th level:
However, warlock patronage isn't bounded by any particular game rule. Unlike the deity rules originating in older editions of D&D, there's no ranking system to show the relative power of different patrons, nor any rules for how many followers they should have.
How many warlocks per patron?
This number is arbitrary and highly variable and not bounded by any game mechanic. As per Player's Handbook, p. 108, Otherworldly Patrons:
What does it cost the patron, and what is their power source?
There's no evidence that it costs the patron anything, nor any rule to suggest the source of the being's power. We do know that patrons are exceptionally powerful beings in their own right:
Archfey have a limited amount of lore, but archdevils and demon princes traditionally occupy entire layers of the Nine Hells or the Abyss because they are powerful, rather than drawing power from those planes. Certainly, however, legendary creatures often gain additional combat abilities while in their lair.
There's no text which would suggest a patron gives up part of their strength to create a warlock. In the 3rd edition sourcebook Complete Arcane, the warlock was described as giving up part of their soul to their patron in payment, which if anything ought to make the patron more powerful.
Nevertheless, a weaker patron having limits is wholly within the realm of possibility. Dungeon Master's Guide p.38 suggests that a normal character should be at least 20th level to become a patron, but this would still place you as one of the weakest. Patrons are described as "nearly godlike" in their power, with Tiamat (CR 30) setting the upper bound for "nearly" godlike. Examples of patrons with available statblocks include Baphomet (CR 23), Fraz-Urb'luu (CR 23), Orcus (CR 26) Demogorgon (CR 26) (source: Out of the Abyss).