That's a couple of big ifs, but even so, unless you have purchased a house as an investment with the intention of renting it out, this is another one of the rationalizations that prospective home buyers use to convince themselves that they're making a smart decision.
As I noted in one of my other comments, many home buyers know very little about the local market they've bought in to. Professional investors and major institutions have purchased hundreds of thousands of homes across the country that they are planning/trying to stabilize and rent out. To my knowledge, Blackstone owns more than 26,000, American Homes 4 Rent owns around 14,000 and Silver Bay Realty Trust owns more than 5,000. These are just a few of the major players. There are countless other smaller players, some of them foreign, doing the same thing on a smaller scale.
It's quite sensible to question the impact this will have on rents in the areas where this activity is most prevalent as the homes are stabilized and rental inventory increases. And one should not ignore the impact these purchases have had on housing prices in these areas.
Net-net: assuming you're comfortable being a landlord, which can be a trying job with even a single property, market conditions and trends vary so significantly that it's simply not credible to state "you can always rent out your house instead of selling it." Heck, as a lot of people found out not too long ago, at times it can be impossible to do either.
But I do have some experience renting places as my family has a few properties they rent and I used to manage a lot of the related work.
Even if you lose a little on the rent, somebody else is now paying for your mortgage and you can enjoy a cheaper apartment elsewhere. Or if you've earned enough, just buy a second house. Mortgages aren't so hard to come by even these days that it's outside the realm of the possible.
They have to move if they were renting, too, and would be have less money (if they didn't leave the very instant rent rose at all) instead of more. Of course, that's just saying that it's better to be long an asset when its price jumps.
Also, if your work doesn't tie you to a region and you've purchased a house, and rents are high, you can always rent out your house instead of selling it. I know several people who have done this, in one form or another, to generally positive outcome.