Ultimately, it depends on how the theme was written. Firstly, jQuery is bundled with DNN, so a theme will typically use this shared reference. In this case, installing a newer JS Library will cause the newer version to start being used. Secondly, most themes include their own version of Bootstrap rather than using a JS Library, so they can't be updated by installing a newer JS Library. In this case, changes to the theme are your only choice.