There are many credit cards that waive the fee for the first year. Is it illegal to open up a credit card account, hold it for a year, then cancel it and then turn around again and re open it and enjoy the 'first' year for free?
It's not illegal, but the credit card issuer might not approve your application for a new card.
Also, the fine print on the contract may state that the waiver only applies to new customers. For example, this card states:
I understand that any new cardmember bonus offers for this product are not available to either current or previous cardmembers of this product who received a new cardmember bonus for this product in the last 24 months.
Even if they do issue you a new card, you'll have a new credit card number, which you'll need to distribute to anybody making regular charges to your card. And the same for online stores that save your payment information (although you might consider that a bonus depending on your position on security vs. convenience).
You're better off finding a credit card that doesn't charge an annual fee (instead of just waiving it for the first year).