Can I subtract guest fees collected from a membership fee when a user registers
One possibility is when they come out as a guest and pay the fee, you provide them with an automatic discount from the CiviDiscount extension, which is applicable to the full "Member" membership type and is automatically given to folks with a current "Guest" membership. 



You may need to play with settings to see for sure if it will work in your case.


Extension page: CiviDiscount
Github: org.civicrm.module.cividiscount



  CiviDiscount: This extension allows the admin to create and manage
  discount codes that can be used on membership and event pages.
  
  Features:
  
  
  Support for price sets and individual items in a price set
  Use of monetary or percentage based discounts
  Automatic discount based on membership
  Generate random discount codes
  Usage and assigned code tabs on a contact record
  Code summary screen displays usage for a given discount code
  Option to apply discounts to additional participants