Yes, we can use "but for" with a similar meaning to "if it wasn't/weren't for" or "if it hadn't been for". Not sure if it can be used in the second conditional though... More info - quoting from 'Advanced Grammar in Use' (M.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.