In so much as they're both custodial services (banks and exchanges), that's right.Wouldn't it be more like a bank getting robbed with your money in it, and the bank is not going to replace it?
One important distinction to remember however (and one which is probably the most common source of confusion to those new to the technology) is that cryptocurrency wallets/accounts do not hold funds, they hold the keys to those funds. The funds are held in the distributed ledger (blockchain) at all times, where they remain secured by consensus, until you (or someone else) transfers the funds by using the keys as proof of ownership. When you use custodial services like exchanges, you're trusting them to look after the keys. Only when you hold the keys yourself (and keep them safe) do the funds truly belong to you. And as long as you do, nobody can take those funds from you. Without the keys, a hacker would need to find a way to convince every node on the network that the funds belonged to him.