I would ask someone about their
food preference
Or to be slightly more formal
dietary preference
or, as already suggested, inquire about more general
dietary restrictions
A lot depends on the context; when talking about recipes you don't need to be as careful about allergens, for example.
(Added:)
For those who are not familiar with the OP's use of the terms "veg" and "non-veg", they are standard terms in Indian English for vegetarian and non-vegetarian food; for example a restaurant sign might say "veg and non-veg" to indicate that they cater to people with both dietary preferences.