It doesn't matter where, as long as you:
- Execute them chronologically - 1 before 2
- Execute them using the same account
This account can be an externally-owned account (aka wallet), and it can be a smart-contract account (aka contract), but it has to be the same account which executes the two transactions, where "execute" means slightly different things if done from a wallet and if done from a contract:
- If done from a wallet, it means - sign each transaction and send it to the node
- If done from a contract, it means - call each contract function