1
I enjoy having a glass of wine with a good company.
I enjoy having a glass of wine in good company.
When company means ‘the people you are with’, it is uncountable, so we cannot say a company.
In this sentence, the usual expression is in good company, rather than with a good company.
2
She is worried because her daughter has bad companies.
She is worried because her daughter keeps bad company.
In the expression keep bad company, we use keep, not have. Company is uncountable in this expression, so we do not use companies.
The expression keep bad company means to spend time with people who may be a bad influence.