I heard sometimes to say 'we're going to have us a beer'. Is this correct? Should it be avoided in standard English? Is it only colloquial?
In America, you'd more often hear "We're going to have beers", or "We're going out to have a beer" or "We're going out for beer" or "We're going out for beers".
"Have us a beer" would be understood, but not common in the US, and if someone said it like that, I'd expect it to be delivered with amusement in the person's tone, because the person is probably being jocular. It wouldn't be used casually.
I don't know how common the phrase is in British English.
Standard English, no. 'Have us' or 'Get us' violates multiple grammatical rules. Same for the singular constructs, 'Have me' or 'Get me'.
However, it's descended directly from the language of low-class Scottish speakers, who brought it to the US (often as criminals or destitute work-seekers) and spoke it as a standard dialect in Appalachia and the Antebellum South. Within the accents where these are spoken, they conform perfectly with the grammar. In the US, it's strongly associated with white hillbillies, rednecks, and okies, the closest there is to a white underclass in the States. This exact same construct still exists in Scottish today, though not nearly as commonly, except that it'd likely be "we'll have us a pint."
From there, it most likely spread to AAVE. In the South in particular, there was an enormous mixing of language between lower-class whites and blacks (who were all lowest-class by default) up until the postwar period. They coexisted and inhabited the same spaces. The Great Migration spread Southern dialects into Northern and Western cities, bringing us the common AAVE we know now.
In the media, it's commonly portrayed as the speech of a caricature of a low-class person, but where I live, in Central California, home of descendants of many okies, it's not an uncommon construction. Sometimes it's a joke, but a number of people here still speak that way unironically every day.
This same accent is where 'Gonna' came from, and the two often pair up.