Q:

Difference between ByteBuffer.allocateDirect() and glGenBuffers()

What is difference between ByteBuffer.allocateDirect() and glGenBuffers()? Why we use on android ByteBuffer.allocateDirect() instead of glGenBuffers() like in classic OpenGL?

A:

But why in every basic OpenGL Tutorial for rendering triangle is used OpenGL object and in every Android OpenGL ES tutorial for rendering triangle is used java object instead of OpenGL object?

Because they can.
ByteBuffer represents a CPU memory allocation. An OpenGL buffer object represents a GPU-accessible memory allocation.
OpenGL ES 2.0 allows users to specify vertex data from either CPU memory or buffer objects. Desktop core OpenGL removed this ability since 2009. So modern desktop OpenGL tutorials use buffer objects for vertex data.
Note that ES 3.0 explicitly says that "client-side vertex arrays":

are  present  to  maintain  backward  compatibility  with OpenGL ES 2.0, but their use in not recommended as it is likely for these features to be removed in a future version.

They haven't been removed yet. But they do interfere with a number of features. For example, they make gl_VertexID undefined.
So you should never use ByteBuffer directly for vertex arrays. And you should avoid learning materials that do so, as they may teach you other bad practices.

