Can someone with diabetes donate their pancreas?

Not for transplant. There may be scientific groups interested in diabetic organs for research. However, a diabetic pancreas will not be used for transplant.
No. Diabetes is a formal contraindication for pancreas donation. If the donor is a deceased donor with type 1 diabetes, the pancreas will not produce any insulin. If the donor is type 2, the majority of those donors are overweight and the pancreas graft will be fatty precluding transplantation due to a higher risk or post-tx pancreatitis and venous thrombosis.
Pancreas transplant. Type 1 diabetics do not make insulin, but if they get a transplant, the new pancreas would make Insulin and the sugars would be normal. It is like having a biologic Insulin pump that works perfectly. For this to work, the donor pancreas must be making insulin. For this reason, diabetes is considered a contraindication to pancreas donation.