Yes, both usages are correct, but mean different things.
"All" means the whole of something. In the first case it is the whole of (the group of) apples in the basket.
In the second it means the whole of the single apple, or of an uncountable mass of substance labelled 'apple' - which might be a lot of mushed up apple or a lot of apple- flavoured something. In either a single apple or an uncountable mass you do not use the plural.
The rule you cite about using the plural noun and verb applies when you are referring to a group (the first case) - i.e. when you are talking about many apples. In the second you are talking about (parts of) a single apple, so it would be inappropriate to use plural noun and verb. (Also it would make the second case was indistinguishable from the first, and so you couldn't tell which was meant.)