No, it is not legal. It is illegal to have an open container of any kind of alcohol in your car in Texas. This is called the "Open Container Law". It is illegal whether it is a can, a bottle, or even a cup of beer. The intent is to prevent drunken driving.