Is it safe to replace a lamp's UK 5 amp round 3 pin plug with a 13 amp rectangular 3 pin plug?
Yes - almost certainly.  You need to get the wiring right (the wires should be colour coded in the usual way - if in doubt post pictures). The pins are in the same positions in both plugs. The 13A plug is fixed unlike the 5A. A fuse should be chosen to match the rating of the cord but you're unlikely to have that information. In that case just fit a 1A fuse unless the bulb is over 200W when you should go for 3A.

The 5A plug is used in theatrical lighting (along with the 15A) but it was also used many years ago when standards weren't what they are now. Watch out for metal housings with no earth wire (double insulation is possible however) or cable with only a single layer of insulation (such as you only see on Christmas tree lights) often as two such wires twisted together. 

A further thought on wiring: rather than the usual brown/blue/green&amp;yellow you may see red/black/green for live/neutral/earth. This is based on ancient British standards like the 5A plug, that were adopted then adapted in some commonwealth countries.