A company's or brand's logo is often protected as a trademark. It may also be protected by copyright, unless it is so simple as not to be subject to copyright protection, unlike a name, which is normally not protected by copyright. But trademark protection is likely to be more important for the kind of use described in the question.
One may not, in general, use a trademark without permission in such a way as to suggest that a product or service comes from the trademark owner when it does not, or is sponsored, endorsed, or approved by the trademark owner when it is not.
One may also not use a trademark or any similar mark in such a way that consumers my reasonably be confused, thinking that the marked product or service is the one for which the trademark is normally used. This is know as passing off.
In some counties a trademark is only protected if it is registered with the government. in others, like the US, some protection is granted simply on use of the mark, although registration may grant additional protections.
It is, in most countries, permitted to use a trademark to refer to the product or service represented by the mark, without permission. This is known as nominative use, because the mark is used as the name of the product or service. Statements such as
- Our cola has half the calories of PeppyCola.
- Our GreatBattery is compatible with a Pear28 cellphone.
However, valid nominative use usually requires using as little of the trademark as possible. In the US at least, this has been interpreted to mean that it is permitted to use the word or words which constitute the name of the product or service to be referred to, but not the logo or other graphic mark for that product or service.
The uses mentioned in the question seem like nominative uses, and it should be fine to use thew name or text representation of the service to be linked to. For example "Buy on Amazon" might be the text of a link to an amazon page from a page advertising a book or other item. But using the amazon graphic logo probably requires permission.
Note that stock symbols are text, not graphics. Moreover, in registering with a stock exchange, I believe that a company explicitly permits the stock symbol to be used to represent the stock, so the trading platform example is a bit different from the other examples. However, use of graphic logos on a trading platform would have the4 same possible issues as other logo uses.
In many cases online companies routinely grant limited permission to use their logos to indicate links to their sites, or compatibility with their products. In other cases they may be willing to grant such permission on request. Any use covered by such permission is lawful, But only to the limits of the permission granted. any use beyond that would need to be justified by an exception to trademark protection, such as nominative use.
Permission would normally cover copyright as well as trademark issues.
Use of a logo protected by copyright without permission. would also be copyright infringement, unless an exception to copyright applies. In the US fair use is the most common exception, and would probably apply to most of the kinds of uses described in the question, which do not harm the market for the original copyrighted work, and fit the other fair use factors. In other countries, there are various exceptions to copyright which may apply, including "fair dealing". The exact scope of these exceptions will vary from country to country. Again, obtaining permission will prevent any such problems.