I need to prototype something quickly as a proof of concept. Is it safe to use mains (UK 230V) on stripboard? It will be going to a transformer so I can control some appliance. Or should I design a custom PCB to do this?
No, just putting some hot glue over dangerous points on a PCB is not enough. You will never pass safety certification that way. You need some kind of enclosure such that probing fingers can't get at the hot spots. Saftey standards will usually require a fuse in series with the AC hot line as soon as possible after it enters your box, then you can connect that to a PCB. The rest of the system must mechanically ensure that those nodes are ineccessible.
If this is a one-off for your lab bench, then hot glue, electrical tape, epoxy, etc is OK, but you have to keep in mind how these things can fail and treat everything accordingly. When working with AC power line on a bench, it's a good idea to use a isolation transformer. That adds one level of safety in that there won't be a conduction path from any of the high voltage to ground. However, keep in mind this changes if you connect a grounded scope, computer communication cable, etc, to any part of the circuit.
Something to consider: Don't use a 5V relay, use one instead intended to run directly off the AC line. This may lower the current requirements of the 5V supply so that you don't need a transformer at all anymore. For a few mA you can use a capactive charge pump, which might be enough to run your micro. In that case the whole circuit will be floating over the AC line voltage range, so you have to consider all of it dangerous. But, if this will ultimately be a sealed unit that only activates a relay, then that should be fine. After all, every AC line power circuit will have some parts at line voltage. The issue is how to deal with that properly.
Another method is to get a off the shelf "power brick" to embed into your product. These are switching power supplies that make isolated DC, in your case 5V, that you can then safely run the rest of your circuit on. In that case it would be easier to use a 5V relay as you originally said.
If your power requirements are only a few Watts or less, then you can push the power supply external. In that case you use a wall wart type power supply and only the isolated DC ever enters your unit. These are small sealed units with only the AC prongs exposed and come pre-certified to various safety specs. Customers understandably find them annoying, but the economics usually dictate something like that for up to around 5-10 Watts.
There are a variety of hot glue adhesives, and there's no blanket statement that could be made to cover all of them.
However, I has seen industry use (ie, on the assembly line) of hot glue around the capacitors of the high voltage section in a CRT for vibration purposes. The glue came into contact with many of the leads and PCB tracks in that area of the PCB, so I know that there are hot glues which are suitable for electrical use, and appropriate even for high voltage insulation, though insulation was not the primary goal in this case.
You can test your hot glue with a mega-ohmmeter if you have concerns about the particular formulation you are using.
Is there a better way to mount these relays?
There are relay mounts and sockets for many styles of relays. You can also get relay connectors and relays with mounting tabs. These are preferable to adhesives for many applications.
When I've needed to mount relays in a chassis I've used zip ties and hot glue for short term and light duty usage, and metal brackets for heavy duty or long term usage.
I don't typically use hot glue on the bare wires and terminals themselves, and if I do I use heat shrink tubing to insulate the wires and terminals first.