If you are in a dungeon, and you see an item with a unique name (e.g. named after a person, such as "Harry's Dagger" or "Tom's Staff"), and maybe the value seems rather low, this may well be a quest item, so don't pick it up. If you pick it up too soon, it may stop you from completing a quest later. If in doubt, you can save, pick it up, then try to drop it. If you can't drop it, it will give a message saying it is a quest item, so reload and leave it there till later.
If you kill a unique boss at the end of the dungeon, he might have a quest item sometimes I guess. But almost always they will be in a chest near him. If you come back to that dungeon for a later quest, the boss may be replaced by some generic mob, but I don't think it will cause any problems.
So basically it is fine to wander randomly.