Is Dash based on CryptoNote or CoinJoin?

DASH is a Bitcoin fork and uses a modified version of CoinJoin to perform private transactions. DASH its anonymity requires activity on the chain, i.e., you need other users to mix with. Therefore, it could take a long time before your DASH are fully "anonymized". Some older reports document mixing times of a few hours for smaller amounts uptil days for larger amounts (e.g. >1k DASH). According to the devs these times have somewhat improved, but the numbers reported are based on testnet if I recall correctly. Thus, you cannot be entirely certain these numbers are also achievable on mainnet.

By contrast, Monero, which utilizes CryptoNote, uses stealth addresses to achieve unlinkability and ring signatures to achieve untraceability. Both are cryptographically verifiable, i.e., backed by math which is peer reviewed. In addition, Monero mixes passively, which (i) gives you plausible deniability and (ii) does not require activity on the chain. A transaction in Monero is instant to the extent that it gets included into the next block, which is similiar to Bitcoin when the network wasn't "constrained" yet.

Lastly, Monero enforces privacy on the protocol level and thus achieves fungibilty. In constrast, DASH allows both transparent and private transactions. In sum, given that Monero's private transactions are (i) backed by math and (ii) do not, unlike DASH, require activity, they are superior to DASH's private transactions.

If there are multiple coins, which one used the name first?

You are probably thinking about DASH and Dashcoin. The latter is a fork of Bytecoin, which, similiarly to Monero, also utilizes the CryptoNote protocol.

What is the history between the name usage?

DASH was formerly called Darkcoin and before that Xcoin. The rebranding to DASH was done in a centralized manner, which caused some controversy in the community and led to one of the developers quitting the project. The predominant reason for the rebranding was to remove the negative connotation associated with Darkcoin, i.e., possible usage on darknetmarkets. Evan Duffield tried to buy the rights to Dashcoin (and trademark) to prevent ambiguity, i.e., people easily mistake Dashcoin for DASH and vice-versa. However, this plan "backfired" and Dashcoin continues to live on.