Let's say I want to buy stocks of Sinopec which is a Chinese company. I would expect to buy it from HKS and in local currency. With the Degiro broker which is Dutch, I see "Sinopec Shangai Petrochem-H in the search in HKS but I cannot buy it; there is no price. Instead of that I can buy another one in NSY "Sinopec Shangai Ads" in US dollars. I can also see other "versions" of the company in the German stock exchange. Can someone explain to me what is happening? If I buy the one from NSY, is it the "real" Sinopec?
If I buy the one from NSY, is it the "real" Sinopec?
No - you are buying an American Depository Receipt. Essentially some American bank or other entity holds a bunch of Sinopec stock and issues certificates to the American exchange that American investors can trade. This insulates the American investors from the cost of international transactions.
The price of these ADRs should mimic the price of the underlying stock (including changes the currency exchange rate) otherwise an arbitrage opportunity would exist.
Other than that, the main difference between holding the ADR and the actual stock is that ADRs do not have voting rights. So if that is not important to you then for all intents and purposes trading the ADR would be the same as trading the underlying stock.
The case you are looking at is rather special, because the Chinese government for the longest time did not allow foreigners to invest in Chinese stocks. The ADRs explained in @DStanley's answer are a way around that restriction; recently there are some limited official ways,
In general, it is perfectly normal for a stock to appear on different exchanges, in different currencies, and it's all the "real" stock. Because remember: a stock exchange is really nothing more than a fancy place for people to buy and sell stocks. There is absolutely no reason why a specific stock should only be traded in one place.
Companies that have decided to be publically tradeable generally want to be traded in as many exchanges as possible, because it makes the stock more liquid, which helps their shareholders. Individual exchanges have different requirements for a stock to be listed for trading there, some may even do it without the company's explicit approval.