Is it good idea to use "tw" instead of "zh-tw" in i18n?

Is it a good idea?

Probably not, but as always: it depends.

Your theme may be using this setting in the html element to flag the used language of your content to the browser. lang - HTML: HyperText Markup Language | MDN This may break if you try non standard stuff here.

Although Apple is a big company, those companies may not be right with their choices 100% of the times.

I would stay with the standard way!