Flexible hybrid process for combined production of heat, power and renewable feedstock for refineries