Yes. Use whatever suits your business, as long as each number is unique and you apply the format consistently. Most accounting software lets you set a prefix and a starting number.
Can two customers have the same invoice number?
Not if you run one sequence for all customers, which is the simplest approach. If you use customer codes, such as ABC-0001 and XYZ-0001, the full number is still unique because the prefix differs. The problem is two invoices with exactly the same reference.
What if the customer pays without quoting the invoice number?
Match the payment by amount and date where it is obvious. If it is not, ask the customer which invoices the payment covers before applying it. Guessing can leave one invoice showing overdue while another is overpaid.
Should I restart invoice numbers every year?
You can, as long as you add the year so numbers do not repeat: 2026-0001 is different from 2027-0001. Restarting without a year prefix creates duplicates across years, which causes the problems above.