I want to create a .dst embroidery file using Java. Are there any supporting libraries available? Or is it possible to convert any kind of image file to the .dst embroidery file
Yes. I've written exactly such a library for python (pyembroidery) and trancoded that to java. It will work for both Android and Oracle Java and has fully fleshed out reading and writing of most major embroidery formats.
https://github.com/EmbroidePy/EmbroideryIO
As part of a parallel project I've also done a considerable amount of work documenting various formats for a wiki on the topic. Located here:
https://edutechwiki.unige.ch/en/Embroidery_format
Which also has all the known technical details for DST file formats:
https://edutechwiki.unige.ch/en/Embroidery_format_DST
As for the second part of the question, embroidery files are vector-like files which provides a series of commands to be issued to an embroidery machine. You cannot directly convert raster-based image files to embroidery because the pixel information does not directly convert to any sort of embroidery machine command instruction structure.