DRH has pretty much answered it in the comments, but the variation can be a lot and its going to be hard or impossible to tell just by looking at a frame, especially if you encounter a counterfeit (more of a problem for carbon fiber, but still; this can be a safety issue if the bikes aren't properly tested). Bicycles have been commonly made out of aluminum for 30+ years, so its not hard to make a poor bike look good.
You may get some clues such as:
Weight (is the frame much heavier than you think it should be?)
Parts spec'd (but this can be a red herring; a lot of cheaper frames are sold with a few high spec'd parts)
Messy joints (a good builder will be careful of making their welds neatly; see also this question on steel, which talks about things like butting)
Manufacturer (I'd be pretty comfortable thinking that a Giant/Specialized/Trek/other major manufacturer is going to be of appropriate quality for the price. If they mess up, there will be a recall. )
Markings; You don't see things like "Road Series" or whatever on quality bikes.
Price (if its too good to be true, it probably is)
How well its put together (e.g. are the dropouts lined up?)
Riding it (is the frame less stiff than you expect? etc.)
A lot of bikes have alloy numbers written on them as fashion -- 6061, 7005 being the most common. But, you can do a lot of different stuff with the same alloy -- mishandling the tubing such as overheating it, or choosing a bad design (e.g. tubing thicknesses) and what not can give you a varying quality frame. A good designer can do better with a less favorable alloy for the type of bike they want to build than a bad designer with a more favorable alloy. As an extreme example, if I designed a mountain bike with the wheelbase of a cargo bike, it would be hard to get the handling down (*).
Note that most people don't buy just a frame -- they buy a whole bike. And you need to consider costs cut on the whole bike. While the second bike you linked (GMC Denali) is cheap, there are some costs cut in a way that I find unacceptably dangerous, such as cutting the handlebar in half to stick gripshifts on a drop bar, versus spec'ing cheap brifters/downtube shifters/bar ends. Also, note the type of headset used. That bike is also quite heavy. The Specialized Allez in the first picture looks cleaner, is much lighter, has a brand name I trust and handles pretty well. Knowing what I know about how the Denali was built up, would I pay the extra 800 dollars if I had to select one of those bikes? Heck yes.
Frames are a critical part of a bike, but you have to take a holistic view of a bike to assess quality. The frame has effects on safety, handling, reliability, comfort and pretty much every aspect of the bike. So do other parts though.
I get a lot of people want to save money on bikes; the name brands do cost more than what you get at Walmart or from online retailer X. Part of that is because you're paying for the brand. Another part is paying for the research & development; designing the bike to meet the price point, making sure its safe and built well. Another part is manufacturing costs (and quality control, which Moz points out in the comments). And you have the cost from the retailer. Often, theres less cost across the board with these non-name brand bikes. But, part of buying a brand is that you're buying into their reputation, that the thing was done right -- engineered for appropriate performance, reliability , safety, warranty for the price point. And for that, you hopefully get a better bike.
A car analogy: You go into a used car dealer, and you see a bunch of compact cars -- Toyota Corolla, Nissan Sentra, Honda Civic, Ford Focus, Renault Megane, Chevrolet Cruze, Fiat Tipo, Volkswagen Golf, GAC Trumpchi , Roewe 350, Seat Leon, Skoda Octavia, etc.
They all look completely reasonable on the outside -- like modern compact cars. Some of them are basically the same (Sentra + Megane, Golf+Leon+Octavia, etc.) architecturally, but are aesthetically different. Others have very different crash test ratings, performance, reliability, etc. You can't tell just by looking at it; a chart of numbers like weight, horsepower and what not may help, but its not a surefire way to weed out a bad one (especially if they're lying). Your clues are the brand's reputations, and just trying to feel out how well the thing is put together. Many people will go for the Corolla or Civic, even if they're a bit more pricey than some of the others, because they know they're getting a well built, quality product from the name.
(*) Surly is trying this; because its Surly, I'd believe it could be decent. If it was a lesser manufacturer, I'd run away. So, maybe not the greatest example, but it makes the point.