Or dry beans vs canned beans; does the cost of boiling the beans actually bring the cost up to be equivalent to canned beans?
Nowhere near, at least in a a pressure cooker. An electric pressure cooker uses 1KW when the heater is running, and you cook the beans for about 35 minutes. The heater doesn't run the whole time but even if it did, that's around 0.6 KWH at most. And you would normally do a bigger batch than you'd get in 1 can of beans. I have been wanting to measure the actual power usage sometime.
On a stovetop you have to soak the beans overnight and then cook them for at least an hour, so energy usage might be higher, idk. OTOH the batch size compensates for a lot.