Now that sidekicks can learn extra attack (Tasha's Warrior Sidekick class) I was wondering how this works. For example if an elk charges 20ft and attacks and gets the charge bonus, can they now use the extra attack to get the charge bonus again without running since they have met the prerequisite already?
Yes, this should work.
As per the answers to the linked question, beasts can use the Attack action to attack with their natural weapons. All attacks listed in the beast's stat block count as natural weapons that are available to the beast, so if an elk choose to use the Attack action, it can use the Ram "weapon" (presumably its forehead/horns or similar) to attack with.
Since Charge is a feature, rather than an action, it can trigger off other action choices. And since it triggers off hitting with a "ram attack" - i.e. an attack with the Ram weapon, rather than a Ram action - it can trigger if you take the Attack action and choose that weapon.
If the elk somehow has the Extra Attack feature (I haven't read Tasha's, but the details of how it gets it are irrelevant to the question), then this will also apply when it takes the Attack action.
Therefore, you can make two "ram attacks" in one turn - and as long as you moved 20ft towards the enemy in order to satisfy Charge, the extra damage and save-or-prone will trigger for both of them.
(Do note that this only works because Charge is a feature, and not an action. You wouldn't be able to do this with something like the Giant Toad's Swallow; if you're choosing the Swallow action then Extra Attack doesn't apply, and if you're choosing the Attack action then you can make two Bites but there's no swallowing rider on either.)