I have an Arduino Uno and I wanted to know if the pro trinket gamepad library works on an Arduino Uno since both have same atmega328p CPU chip.
The Pro Trinket has a USB connector wired to the ATmega328P, and the Pro_Trinket_USB_Gamepad library uses this connection to impersonate a USB gamepad.
The Arduino Uno also has a USB connector, but it is not wired to the ATmega328P. It is instead connected to an auxiliary chip (an ATmega16U2) which serves exclusively as a USB-to-serial converter. Since your sketches run on the 328P, and the 328P has no access to the USB port, you cannot use this library on the Uno.
Well, actually you may be able to use the library if add an extra USB connector, and link it to the 328P. See how it is done in the schematic of the Pro Trinket 5V. Beware of the 3.6V Zener diodes: these are needed to avoid damaging the serial port of your computer.