The answer is NO, this was an easy question. A diesel boat isn't set up with the safety measures required for gasoline machinery, which are primarily bilge ventilation and ignition protected devices. On a boat with gas engine(s), every installed electrical component if required to be ignition protected (alternator, starter, pump motors, relays, etc). On a diesel boat this really isn't a concern due to the much higher flash point of diesel compared to fuel so you may have one or more non-ignition protected devices in your boat which would be a concern with a gas system now installed in the hull. The electrical systems of these old "trawlers" have been tinkered with for several decades now and you never know where a previous owner installed some non-ignition protected device in some hidden spot that you would overlook.
In theory you could retrofit the boat to address these concerns but you will probably spend same as the additional cost of a diesel generator over a gas unit. It would also make any surveyor leery, even if everything was done correctly. If you absolutely need a generator on the cheap, a portable unit is much more straightforward, just follow all the gas storage precautions you would with a gasoline powered dinghy.