My understanding is yes and yes - that is one of the purposes of both. Bonds in these cases are typically held in your bank account, which is unaffected by said bankruptcy.
An unconditional bank guarantee is secured by the bank so it's the bank that has to hand over the money if you ask...