You can charge whatever rate your customer is willing to pay, but that's just the flaming capitalist in me talking.
I doubt I could charge a higher rate to work on crappy code. To me that sounds too much like punishing the customer for the sins of the previous developer. Writing code is writing code and I would bill accordingly.
That is a serious and legitimate concern. I worked with bad code long enough to get pretty good at deciding when it is better to scrap the crap and start a re-write. Life is too short to work with crappy code. And the customer must be led to understand that it really is better and it will go faster starting from scratch than working with code loaded with stacked sequences, 2000 x 2000 block diagrams, hundreds of locals, etc. etc. I would like to think I have become quite the expert at making these determinations.