I found a problem and it is now solved. I ran lr-dosbox-pure in verbose mode and in log /dev/shm/runcommand.log I found error:
eglCreateImageKHR: failed to create image for buffer
After searching for a while on the Internet, I found a tip for editing the file /boot/config.txt and add the line:
gpu_mem = 256
After this the display no longer flashes (flickering) and everything works fine.
I still have to figure out how to emulate a mouse like a touchpad...