You can mix coffee grounds in with the potting soil but the coffee grounds cannot be used solely as potting soil otherwise the garden will be too acidic which can kill the plants.
You should use your regular potting soil and then mix around a cup full of the used coffee grounds into the potting soil and then plant your vegetables or other plants in the potting soil.
The coffee grounds when added to the potting soil will make the potting soil much better for growing vegetables and other plants.
Just avoid putting too much coffee grounds in the potting soil or around the plants because then the plants will become to acidic and then it could kill the plants.
But adding some used coffee grounds to the potting soil is perfectly fine.