This is extremely common in institutional markets, and is called a "repo" transaction - short for Repurchase agreement
In a repo transaction, you "sell" the bond to the bank and agree to buy it back again at a fixed price in the future (regardless what the actual market price may be). This is the same business model as pawnbroking. If you fail to buy the bond back, the bank gets to keep the bond. The reason it is done as this sale-and-repurchase, rather than collateral (which is economically identical) is that it makes handling a default much simpler. If you default on a collateralised loan, the lender still has to apply to take full ownership of the collateral, which can delay matters (such as under chapter 11 protection). In a repo transaction, the bank already legally owns the bond and has it in custody, so it is much simpler. It is worth noting, that although they have bought the bond from you the repo agreement (GMRA - "General Master Repo Agreement") specifies that the original owner retails "full economic interest" in the bond - that is they get any interest payments from the original bond.
That said, this is most commonly done for Treasury bonds in highly rated countries (US, UK, Germany etc.). Since the bond is collateral for the loan banks are less keen to lend you for bonds that are risky, as should the collateral become worthless, then the loan becomes unsecured. For this reason repo transactions in EM bonds or Corporate Bonds tend to have a significant "haircut". The haircut is the difference between the value of the bond and the amount borrowed. So in your example, a repo transaction of a poor country bond the bank may take a 20% haircut, so to buy \$10m of the bond, you would borrow \$8m and pay for \$2m yourself. The logic here is the same as when you mortgage your house, the bank won't usually lend you the full value of the house.
As you might have guessed from my example using millions, repo transactions are done between banks and institutional investors, not the man-on-the-street.
For extensive details see: ICMA Guide to Best Practice in Repo