Yes it is permissible to buy and sell stocks in the stock market in any country as far as the company is not dealing in unlawful business like alcohol, pork, usury, weapons for harming people, gambling, production of sinful materials, etc.
Shares of any company involved in unlawful activity is unlawful to deal with.
Wassalam.