Yes, per description of the features used in your game.
The Ritual Caster feat provides the following information about adding new spells to the book:
If you come across a spell in written form, such as a magical spell scroll or a wizard’s spellbook, you might be able to add it to your ritual book. The spell must be on the spell list for the class you chose, the spell’s level can be no higher than half your level (rounded up), and it must have the ritual tag. The process of copying the spell into your ritual book takes 2 hours per level of the spell, and costs 50 gp per level. The cost represents material components you expend as you experiment with the spell to master it, as well as the fine inks you need to record it.
Among the examples, there is exactly a wizard's spellbook. The spells in the Warlock's tome are spells in written form, as requested by the feat, but the spell must belong to the Wizard list. In the case of the wizard, since the Ritual Caster feat has been chosen within the Wizard "tag", there are no issues.
The Book of Ancient Secrets has a similar description:
On your adventures, you can add other ritual spells to your Book of Shadows. When you find such a spell, you can add it to the book if the spell’s level is equal to or less than half your warlock level (rounded up) and if you can spare the time to transcribe the spell. For each level of the spell, the transcription process takes 2 hours and costs 50 gp for the rare inks needed to inscribe it.
Since there the warlock has no restriction on the class spell list they can take the spell from, there are no issues for them.
Eventually, the box about the wizard's spellbook explain how a wizard can add more spells to their book:
Copying a Spell into the Book. When you find a wizard spell of 1st level or higher, you can add it to your spellbook if it is of a spell level you can prepare and if you can spare the time to decipher and copy it.
Copying spells from the ritual book of the bard pose no problems, since, as observed before, this feat has been taken with the wizard tag, whilst the allowed spells to be copied from warlock's tome must belong to the wizard list.
These are the written rules: your DM has the option to rule them out for some reasons, such as thematic ones or narrative ones, for example the tome of the warlock is written in infernal/diabolic symbols inintelligible from other classes.