It is theoretically possible.
Blockchain.com estimates that the hashrate of bitcoin is 13,000,000,000,000,000,000 hashes/second. Any one of those hashes could be "The lucky one" that earns 12.5BTC. Your CPU can get on the order of 2,000,000 hashes/second (plus or minus). This means your computer has roughly a 1 in 65,000,000,000,000 chance of being the lucky one that mines the block. The remaining 64,999,999,999,999 times, it's someone else (typically someone with a huge ASIC rig). If you mined for a billion years, you could actually expect to mine a block (using "expect" as in the statistical "expectation" of a random variable).
A bitcoin block is mined roughly every 10 minutes. At $20k per bitcoin (extrapolating a bit, based on its current excitement), that's $250k generated every 10 minutes. You have a 1 in 65,000,000,000,000 chance of being that one. Accordingly, your expected earnings (due to that random luck chance of getting the right chance) is .0000003846 cents/10minutes, or .0000023 cents/hr. If you are spending more on electricity than that, you're wasting your money.