Appelsin comes from Dutch appelsien, which used to mean Chinese apple (Sina=China) after the fruit's country of origin. (Just a fun language fact that might serve as a mnemonic)
That rule doesn't apply to everything. It's more of a rule of thumb than an actual set rule.
there is no "a", there is "et" and "en", the "et" mostly goes for things that are NOT alive, to where "en" is for alive objects, but it's Danish, sometimes "en" goes for things that are not alive so you have to learn them by heart ;)