They are used interchangeably in many recipes. Also used as a thickener.
There is some confusion, as in the main regions where they are used the names are different of other areas'. Tapioca for some is the powder (otherwise named 'goma de mandioca' or 'polvilho' - both nouns in Brazilian Portuguese language) - from manihot, thus for making a kind of pie or cake or something else that they call it; in other regions however tapioca is the pie itself, made from the powder of cassava chips, these having been grated (preferably manually), whereas the name cassava is not known by many people at all. So if you are real vegan, do not use 'polvilho' as it certainly is dairy, but this is an extreme atitude.
No, you would need different amounts of each for a recipe and I don't believe I'd try substituting as baking is usually very sensitive to changes, due to it's very "chemistry like" process.