Yes, this is possible, but with some limitations.
You can call a function based on its ABI, so in your case
will call the Bar function of your contract. If the function takes an argument, you can add it to the call like so:
The only limitation to this is that you cannot return a value from this function, it only returns true, or false if it hits an exception.
You could use a global
result variable, though.
In terms of security, it really depends on the context but be careful using
msg.sender for authentication -- you may want to use
delegatecall depending on your needs.