A bit of both really. Also as you do your class quests you should be rewarded with new gear equippable by that class too - in fact, some of the early class quests have unique gear that you can't get anywhere else (Custom Robe of Healing for CNJ, Custom Cuirass for GLA etc).
Levequests also reward gear as well - in particular, during a leve there is a chance you may come across a treasure chest which will often have a piece of 'pink' aetherial gear inside, which have unique stats and can be better than the equivalent gear you can buy from a shop at that stage. But yes, later in the game dungeon gear is usually better than crafted gear or gear bought from stores.