You might be able to but you really shouldn't. At the best you wouldn't have control over fan speed. Find the wiring diagram for the board and use a fan header
Per https://help.prusa3d.com/article/xbuddy-and-loveboard-electronics-wiring-mk4_413095 it looks like you dont have any fan headers, you might be able to repurpose the unused ambient sensor header but no clue sorry. You might try splicing off the part or hotend fan? If you really wanted to use the dc input you might need a voltage step down buck converter or something depending on what your PSU is putting out
Pi’s are usually 5vs, they won’t drive a 24v fan happily at all.
At that point what you can do is a power relay- like how most bed heaters work. That could be controlled by a pi, but delivers power from a 24v source.
If the charger is a 24v powesupply, that would work. I would also suggest getting a switch to put in line so you don’t have to keep unplugging it- either a rocker switch or mini toggle.
Not sure how familiar you are with electronic stuff, but the fans I have are 24v and 0.1A my laptop charger outputs up to 6A that shouldn't be an issue right?
With a fan it won't be a big deal if the charger outputs 19-24V. Do you have a multimeter? Do you have a 24V source anywhere on the board? Using a laptop charger for 24V/0.1A is just way overkill. It'll work just fine though. You might also get some 24V LEDs to run off it too since you'll have all that extra current capacity.
Powering the fan from gpio pins probably isn't going to work out well either, they are 3.3v and 5v. Powering the fan from the PSU is going to be similar to powering a pi off it, I believe you should step the voltage down to what each needs, where the fan is 24v I think the pi is 5v. Your PSU is probably 115 or 220 v. For connectors I would expect to have to redo them yourself with micro fit, molex, jst or w/e you want and can get. On some of mine I just did single pin molex on the pins of the white female connector for fan headers, it doesn't lock but it works if you don't have a lot of movement. This page is awesome for connectors info https://www.mattmillman.com/info/crimpconnectors/common-jst-connector-types/
Honestly if your going to go through all this effort to make this work, and already have a pi, I would suggest instead upgrade the control board to something with extra fan headers, led heads, etc and switch to klipper, there have to be guides out there for your specific printer