I want to write a galaxy tool to do some process on tabular blast data. is there any way to first call makebalstdb and then blastp with my desired options inside my code and then do the process?
If it is a tool for your own local galaxy it is definitely possible. You could start with making your pipeline with bash/python/snakemake or whatever you like and make sure you can run it from the commandline with a single command. After that you can build a galaxy wrapper around it.
These links could help: