If I develop a product as part of a project at university, does the university have any ownership over it? To specify further, this is an undergraduate project, not a PhD, so (I think) that this is not directly funded by the University, and I am studying in the UK.

I ask because I have a few ideas about what I am going to make and I'd rather not use some of the better ones if I am going to get into legal debates if they do somehow manage to be successful. 

It's worth noting that the "good" ideas aren't necessarily better from a technical standpoint so the only thing I'd gain from using them is a years head start on development. I guess I am just curious.
Usually, if you use the university's resources then the university has some claim to what is produced. If you produce it on your own time using your own resources, then it should belong to you. Some companies have rules in their contracts stating that anything you produce while you're employed by the company belongs to the company. Some universities lay claim to a percentage of your profits if you apply for a patent through the university's patenting office; you give up the headache of patenting, they take 30 or 50% of the profit.

In all cases, it depends on the country and your university's policies (hence the generic answer above). I would suggest you look for the IP/patenting office in your university and talk to them. You could also ask your professor. If you're really serious, then talk to a lawyer.