That depends on the constitution of the country and how UBI is implemented. You can enact laws and mechanisms that prevent governments from influencing the UBI and make it very hard for parliament to change it in a negative way, e.g. require a 2/3 majority and other hurdles. You could even add a right to UBI in a section of the constitution that cannot be altered. Germany has the so-called Ewigkeitsklausel, for example, that makes any attempt to alter articles 1-20 of the constitution invalid.
It's perfectly possible to build in security mechanisms.
It's perfectly possible to build in security mechanisms.