Can we pass Inputstream for Conversion to officeToPDF() or is there any other API that can take inputStream of doc file?

Yes, it is possible to convert files in memory without using filepaths. Please see the post here on how to do so: