Yes, you can add a customer which is also a vendor in QuickBooks Online however, you'll need to add a character or symbol on one of the names so you can save it without any error.
To add a customer:
Go to Sales tab and select Customers.
Click Newcustomer.
Enter or add customer details.
Select Save.
To add a vendor:
Go to Expenses tab and select Suppliers.
Click New supplier.
Enter or add supplier details. Make sure to add a character or symbol if you're adding the name as a customer.
Select Save.
Additionally, you may find these articles helpful: