Is it ok to diet while breastfeeding?

No. You should be eating a very well rounded, well balanced healthy diet for your health and your baby.
Eat right. Good fats such as olive oil and coconut oil are fine in sensible amounts. Eat a rainbow of organic vegetables and just enough protein. Eat complex carbohydrates, avoid sugars and limit flour products.