8 gauge wire for 10 gauge
Yes, if it's approved for the line voltage and temperature and if connectors (e.g. wire nuts) are sized to fit. A lower gauge number means heavier wire, able to carry more current safely, with lower voltage drop for the same  length, so it should be quite safe if fused correctly for 10-gauge.

The reason heavier wire than necessary is not used is to save on the cost of copper, and to avoid difficulty in routing and bending thick wire.