As some of the other answers have correctly stated, the Bugbear does not have any ability to grapple at further than the usual 5 feet -- but let's lay that quibble aside. Let's just assume you've polymorphed your ally into a giant and address the real question of whether sticking an arm through a wall of fire will burn.
As written in the wall of fire spell ...
Bugbear Takes Damage
TLDR: What is "inside" in this context? Also, Wall of Fire is a confusingly written spell.
This seems very clear cut to me. The text of the spell is:
You create a wall of fire on a solid surface within range. You can make the wall up to 60 feet long, 20 feet high, and 1 foot thinksic, or a ringed wall up to 20 feet in ...
A bugbear cannot mantain a grapple with a target 10 feet away.
The Long-Limbed trait of the bugbear in Volo's Guide to Monsters states (VGM, 119):
When you make a melee attack on your turn, your reach for it is 5 feet greater than normal.
And the grappled condition on a creature can end either if the grappler is incapacitated, or
if an effect removes the ...
RaW, the bugbear takes no damage.
By the rules as written, the bugbear is not in the area that causes damage, so it won't take damage.
One side of the wall, selected by you when you cast this spell, deals 5d8 fire damage to each creature that ends its turn within 10 feet of that side.
The bugbear is 15ft away.
A creature takes the same damage when it ...