In general, who can apply for research grants (in Europe)?
Rules will very strongly depend on the funding institution you're applying to, and even on the details of the grant program. Eligibility criteria are listed in each funding program, so go check up those programs that are of interest to you. Even restricting to “in Europe” doesn't help much, because Europe is a large continent with very heterogeneous research (and funding) institutions.

Regarding students (undergraduate or graduate), the only types of grants I can think of are:


grants to fund your degree; for example, getting a fellowship that would fund you during your PhD
grants that encourage international collaboration and exchange; e.g., the Chateaubriand fellowship to spend some months in a French lab, or JSPS fellowship for short stays in Japan.


A student is expected to devote his efforts to the project for which he is employed, not to bid for new research projects on their own. Thus, I don't think you can get funding for a new research project of your own, until you are an independent researcher.