As Tom says, the 40p per mile figure CAN be used by the self employed too but it certainly wouldn't normally be done that way. It would be much more usual to claim your correct vehicle expenses and make a private adjustment to the costs where necessary (whether it's necessary or not depends on whether the vehicle is also used for personal purposes - if it's only used for business there would be no problem with all it's expenses being claimed).
What isn't clear at all here from the OP is what he means by "travelling to and from work"? If you have an office that you work at, then travel to and from that office to home is NOT a business expense and isn't allowable at all. You'd get no deduction for it, just as there's no allowance for those of us on PAYE to get to and from work. However, if you actually meant that you work at different sites all the time and your base is your home (like a jobbing tradesman) then the travel to the work site WOULD be allowable as a business expense. You need to be clear about which it is.