I'm not a programmer, but consider a P2P cryptocurrency with an initial centralized online exchange that the P2P program runs. The program gives more Coins to miners when the price of the cryptocurrency is deemed too high and gives fewer coins to miners when the price is too low similarly to how a government might do so. Thus, the program is able to peg the currency value and maintain long term and short term price stability.
It's difficult to understand what you mean by "initial centralized online exchange that the P2P program runs". My best guess is that you'd like to consider an entity X that the P2P protocol recognises as special for a limited time. X would have the job of controlling the rate of issuance of the currency. Of course, at any time when the cryptocurrency is losing value against your reference currency, X would be helpless to maintain the peg (it could not reduce the supply), but we'll ignore this weakness, settling for the idea that some control is better than no control.
What you have in effect is what's known as a 100% pre-mine. We begin an alt-coin where X has all of the coins and the network is sustained by transaction fees alone. X then gradually injects these coins into the economy, adjusting the rate in an attempt to limit the value of a unit of the alt-coin in terms of a reference currency.
The closest example to this I'm aware of is Ripple. X in this case is a company called Ripple Labs (formerly OpenCoin).