As I see it, it's not a mathematical problem, it's OB (Organisational Behaviour) problem. What bonus level will provide similar incentive to employees at different salary grades and different companies?

First, you define your bonus policy, then just follow it. Nothing to do with mathematics )))

For eg, it is common to fix bonus as % of annual salary. (Then higher paid employees receive higher bonuses.) Everyone understands exactly what to expect in their annual bonus, as they know their salaries. And everyone gets equal %age of salary as bonus (relatively fair...), may be dependent on their performance (say, you can have 5%, 10% and 15% for low performers, average, high performers).

Another approach is to say everyone gets fixed absolute amount, regardless of their salaries. In my company, we use % of salary (with grading based on performance), but some employees (lower grades) are not eligible for that, so they get a fixed annual 'handout' of say 1000 dollars or similar. Everyone at their grade gets the same.

So, your stragegy will be determined entirely by what you are trying to achieve - to equalise pay and bonus in both companies? just do that. To keep the salaries difference but give out equal bonus to everyone? do that (you can fix absolute amount of bonus so that everyone sees they get what the other guy in Company X is getting).