Yes, you can bring ground coffee into Mexico for personal use, but strict limits apply.
It is strongly recommended to declare all agricultural products, including coffee, upon arrival. Mexican customs officers may inspect items, and undeclared goods can be confiscated.
Regulations can change. Check with the Mexican embassy or consulate before travel for the latest rules on importing food and agricultural products.