Mario Kart 8 has coins scattered about the track which make you go faster and contribute to unlocking kart customisations. Coins can also be obtained from item boxes - there's one item that gives you 2 coins when activated. These (obviously) contribute to making you go faster, but do they contribute to customisation unlocks?
The number of coins added to your total is the number of coins that each local player has at the end of each race. Regardless of how you collected a coin, if you have it at the end of the race, it counts.
For more details see the Mario Kart 8 Total Coins Collecting Logic question.