Q.Is it okay to have mealy bugs in your composter?
If not what is the solution?

Certified GKH Gardening Expert
Unless you turn the composter often enough and have the proper ingredients, it won't get hot enough to kill insect pests. I would recommend removing the stems with mealybugs on them. In the future, watch for any infested plant material and throw it in the trash rather than the composter. A few bugs that don't harm plants are OK, but mealybugs are sapsuckers that will harm plants if they survive the compost bin and are applied beneath plants.
https://www.gardeningknowhow.com/composting/basics/compost-pest-control.htm