The government has warned pharmacies could lose rights to dispense NHS prescriptions following a series of complaints.