It is safer not to put any weeds in your compost. But you can if you are careful and avoid putting in weeds that have gone to seed, or spread by runners. If you have a hot composting system then it should kill any weed seeds, or you can put them in a black plastic bag first for a few months. - greygardener
Many years ago I did exactly this but some years later it backfired on me. I was (I thought) careful not to put in weeds that were "seeding" BUT somehow they did sneak into my garden bed. My answer now is no - don't take the risk! - BibbyKat