This depends on a number of factors. You must make a claim through your own policy and have comprehensive cover. You would then receive a courtesy car providing you use the approved repairer, subject to availability and only for the duration of the repairs. If your vehicle were written off a courtesy car would not be provided in the above circumstances.
If you have an accident that is not your fault you could be provided with a hire car by your legal cover, irrespective of the cover on your policy.