The National Rail Conditions of Carriage cover these circumstances as follows:
3. Where the full range of tickets is not available
If you cannot buy an appropriate ticket for the journey you want to make because the range of tickets that is available at the station from which you intend to start your journey is restricted, you must buy a ticket or Permit to Travel before you travel that entitles you to make at least part of the journey. You must then, as soon as is reasonably practicable, buy an appropriate ticket to complete your journey. In these circumstances, you only need to pay the fare that you would have paid if you had bought a ticket immediately before your journey. The price you will have to pay will be reduced by the amount paid for the ticket or Permit to Travel.
16. Starting, breaking or ending a journey at intermediate stations
You may start, or break and resume, a journey (in either direction in the case of a return ticket) at any intermediate station, as long as the ticket you hold is valid for the trains you want to use. You may also end your journey (in either direction in the case of a return ticket) before the destination shown on the ticket. However, these rights may not apply to some types of tickets for which a break of journey is prohibited, in which case the Ticket Seller must make this clear when you buy your ticket.
Carry a copy of these conditions with you in case you need to refer to them while travelling.
No, I buy it from the machine, one of which is usually working, which I have always presumed I should do.
I asked a guard if I could buy from him instead and he said I should really buy from the machine if it is working.
That is generally taken as the correct thing to do to avoid getting into trouble unless you need to use an accepted payment method that the machines do not take. (For example, some machines do not accept cash.)
Will a guard sell me one even though the extra cost is £0.00p?
Yes - they will replace the ticket you bought with the one you wanted to buy but were unable to purchase if you explain this (and remind them of the relevant conditions if need be). On some occasions they might just endorse your ticket as a quicker alternative. If anyone refuses, then you should make a note of the circumstances and raise a complaint later, then try again at the next opportunity with someone else or at a ticket office.
There is no technical reason preventing ticket machines from selling tickets with a different origin and plenty of machines across the country do this. If this facility is not offered somewhere it's purely a business decision made by the train company concerned to prefer the use of the Condition 3 method quoted above.