Suppose I have two batteries one inside the laptop with 2.5 AH giving a backup for around 2 hours. The battery is external inside a UPS system with 7.5 AH. Since it has thrice the capacity of the previous one, can I conclude it will give backup for 6 hours?
No, you cannot, since you have not specified the voltages of the two batteries.
Ignoring converter losses, the relevant quantity is not amp-hours but watt-hours. So let's say the laptop battery is 18 volts and 2.5 amp-hours, while the UPS is 12 volts and 7.5 amp-hours. The energy available from the laptop battery is 18 x 2.5, or 45 watt-hours. The energy available from the UPS battery is 12 x 7.5, or 90 watt-hours. All else being equal, the UPS will provide twice the duration of the laptop battery.
All else, of course, is not equal. The laptop battery power goes through a set of DC-DC converters to provide the actual voltages used by the circuits, which have an efficiency less than one. The UPS battery power goes through an inverter with its own inefficiency, and the resulting AC goes to the laptop where it is converted to the required internal voltages. Consequently, you'd expect the overall efficiency of the UPS battery to be less than the efficiency of the laptop battery. Exactly how much less this is, and its effect on the ratio of the two durations, is not something which can be figured out from first principles.
You have to compare the energy content which is equal to Ampere hours times voltage. Also with the UPS system you have losses in the voltage converter.