This is a tricky question. You can't copyright a colour scheme as such, but certain colours (or combinations of colours) can be registered as patents for uses in specific categories. For instance, in the UK, Royal Mail has a patent relating to the use of the colour red in relation to postal delivery services so no other companies that deliver mail and parcels in the UK can have red vehicles or red uniforms.
For the examples that you have mentioned, you could use the same colours that have been used by these companies as long as you weren't producing a logo that looked like the existing logos or that operated in the same product / service categories.
There are a couple of basic principles that are useful to remember:
'Passing off' - this is the idea that you are trying to pass your product or service off as being the same thing or related to the existing brand. So if you design a logo for a delivery service that uses the same colours and styling as the FedEx logo then you would be guilty of implying an association with FedEx and attempting to trade off their good will and reputation.
'The stupid person in a hurry' - this sounds harsh, but the idea is that if a person uneducated in the details of brand identity, who is not paying close attention could confuse your logo / product / brand with that of an existing, established brand then you have infringed the IP of that brand by allowing your brand to be mistaken for it.
It's all common sense really. If you suspect that you are infringing the IP of an established brand, then you probably are so don't risk it. Just taking inspiration from a colour scheme and applying it to something completely unrelated is fine.