When crafting an item, the Odds of Quality are displayed at the bottom of the screen before you commit to crafting. If a percentage is displayed in a rarity's corresponding color, then this means there is a possibility of receiving gear of that quality.
Even if the percentage is high that you will get one quality, anything less than 100% odds will mean there is always a chance of receiving something lower.
The only way to ensure that your item is crafted at a particular quality is to use all of the same quality items in crafting, including the Gear piece broken down.
If you risk using lower quality materials in your crafting, there is no way to reverse the transaction if you don't get what you were hoping for. However, you can upgrade a piece of Equipment's quality by tapping the blue “Upgrade” button next to any piece of equipment in your Equipment tab of the Smithy. Upgrading requires 3 pieces of similar quality and level equipment to consume.
For more information on quality levels of materials and upgrading materials and Equipment please visit our Advanced Crafting Guide here.