You can enclose arbitrary amount of vertices within glBegin/glEnd statements. Does OpenGL limit the number of vertices you create or it allocates memory for more?
OpenGL implementations aren't assumed to have unlimited memory, but the specification imposes no specific restrictions on this. That is, you can't ask how many vertices you can send. Instead, if you trip some limit, you'll get a
GL_OUT_OF_MEMORY error and rendering will fail.
But in 2023... you're really should not care. If you're using old compatibility APIs from 1992, then you probably aren't going to be sending enough vertices to trip any limits from any card that was made after the year 2000. So this is basically sophistry.