A 17 year old can go into a pub at any time but cannot buy or drink alcohol (except as detailed below). Under 16s can only go into a pub if accompanied by an adult but, after midnight, they cannot go in either alone or with an adut.
The 18 year old can, in fact, buy alcohol consisting of beer, wine or cider for a 16 or 17 year-old with a table meal . In all other cases, it is illegal for children under 18 to knowingly consume alcohol on relevant premises, or to buy or attempt to buy alcohol. Where the alcohol is consumed by accident, the child will have committed no offence.