That depends on how you're investing in them.
Trading bonds is (arguably) riskier than trading stocks (because it has a lot of the same risks associated with stocks plus interest rate and inflation risk). That's true whether it's a recession or not.
Holding bonds to maturity may or may not be recession-proof (or, perhaps more accurately, "low risk" as argued by @DepressedDaniel), depending on what kind of bonds they are. If you own bonds in stable governments (e.g. U.S. or German bonds or bonds in certain states or municipalities) or highly stable corporations, there's a very low risk of default even in a recession. (You didn't see companies like Microsoft, Google, or Apple going under during the 2008 crash).
That's absolutely not the case for all kinds of bonds, though, especially if you're concerned about systemic risk. Just because a bond looks risk-free doesn't mean that it actually is - look how many AAA-rated securities went under during the 2008 recession. And many companies (CIT, Lehman Brothers) went bankrupt outright.
To assess your exposure to risk, you have to look at a lot of factors, such as the credit-worthiness of the business, how "recession-proof" their product is, what kind of security or insurance you're being offered, etc.
You can't even assume that bond insurance is an absolute guarantee against systemic risk - that's what got AIG into trouble, in fact. They were writing Credit Default Swaps (CDS), which are analogous to insurance on loans - basically, the seller of the CDS "insures" the debt (promises some kind of payment if a particular borrower defaults). When the entire credit market seized up, people naturally started asking AIG to make good on their agreement and compensate them for the loans that went bad; unfortunately, AIG didn't have the money and couldn't borrow it themselves (hence the government bailout).
To address the whole issue of a company going bankrupt: it's not necessarily the case that your bonds would be completely worthless (so I disagree with the people who implied that this would be the case). They'd probably be worth a lot less than you paid for them originally, though (possibly as bad as pennies on the dollar depending on how much under water the company was). Also, depending on how long it takes to work out a deal that everyone could agree to, my understanding is that it could take a long time before you see any of your money.
I think it's also possible that you'll get some of the money as equity (rather than cash) - in fact, that's how the U.S. government ended up owning a lot of Chrysler (they were Chrysler's largest lender when they went bankrupt, so the government ended up getting a lot of equity in the business as part of the settlement).
Incidentally, there is a market for securities in bankrupt companies for people that don't have time to wait for the bankruptcy settlement. Naturally, people who buy securities that are in that much trouble generally expect a steep discount.
- Trading bonds is (arguably) risky compared to trading stocks
- Holding certain kinds of high-quality bonds to maturity is low-risk even in a recession. The key word is "certain kinds" - just because a bond looks low-risk doesn't mean that it actually is once you account for systemic risk.
- Even in the event of a bankruptcy, that doesn't necessarily mean that all is lost. If the debt was secured or insured you may get money back, and you could get money back even in a bankruptcy (either by getting a settlement in bankruptcy court or selling it to a distressed debt fund at a discount).