I feel they are very similar, but do have a few key differences. If these differences matter enough to make a moral difference is something we can discuss.
A few of the key differences, in no particular order:
1. Trading card games come with base sets that have guaranteed cards and are useful for playing the game. This makes it TCGs better.
2. CCGs can be traded to others or sold. This one I'm unsure about.
3. Loot boxes are wrapped into games and are often designed to appeal to players in a much more intrusive way than TCGs . This makes loot boxes worse.
4-1. Some loot boxes have no impact on gameplay. These make loot boxes better.
4-2. Some loot boxes have an impact on gameplay larger than the impact of buying TCG boosters. These make loot boxes worse.
5. Loot boxes are often purchased through currency systems made to separate the buyers understanding of how much they are paying. This is why games often make you buy some currency and then use that currency to buy loot boxes, with some games have layers of currency in between. Compare this to TCG boosters which are sold in stores for specific dollar amounts. This make loot boxes worse.
6. You can buy specific cards you need directly from other players, while most loot box systems require buying more loot boxes until you get the specific item desired. This one is related to 2 and I am also unsure about.
7. Loot boxes are often built into games on ones phone and use tactics to encourage worse spending habits. This make loot boxes worse.
Overall my personal opinion would be that loot boxes as a whole are worse than TCGs, but the better done loot boxes are comparable or slightly better (less predatory) than TCGs while the worse loot boxes are much much worse (more predatory).
Edit: One way to look at it is that the more predatory loot boxes are an extension of TCGs that doubled down on the worse parts, which might be enough for it to cross a person's personal moral threshold.